Skip to content

fix: get_symbol_detail returns source for branch/tag refs (Phase 0)#6

Merged
csharp36 merged 1 commit into
mainfrom
fix/phase0-source-code-null
May 29, 2026
Merged

fix: get_symbol_detail returns source for branch/tag refs (Phase 0)#6
csharp36 merged 1 commit into
mainfrom
fix/phase0-source-code-null

Conversation

@csharp36
Copy link
Copy Markdown
Owner

Summary

Phase 0 of the tagged-release full-indexing design.

  • get_symbol_detail previously read a symbol's source from the on-disk clone working tree (always checked out to main) via readSourceLines, so querying a symbol on any non-main ref returned source_code: null.
  • It now reads source from file_contents.content for the file the effective_files overlay CTE already resolves per ref, slicing [start_line, end_line] in Java via a new sliceLines helper. Works uniformly for main, branches, and tags.
  • Removes the disk dependency entirely (readSourceLines deleted, plus three now-orphaned imports). Metadata-only files (binary/oversized → no file_contents row) still correctly return null source.

Delivers the "read the suspect symbol" step of the no-local-checkout debugging workflow on its own.

Test Plan

Four TDD integration tests added to BranchQueryTest (Testcontainers):

  • source returned for a main file
  • source returned for a branch-only file (the core bug)
  • null source for a metadata-only file (no content row)
  • correct line-range slice

./gradlew build → BUILD SUCCESSFUL (12 tests, 0 failures).

🤖 Generated with Claude Code

@csharp36 csharp36 force-pushed the fix/phase0-source-code-null branch from 7ec0ba6 to cd0b916 Compare May 29, 2026 20:18
Read symbol source from the overlay-resolved file_contents row instead of
the on-disk working tree (always on main), so non-main refs no longer return
source_code: null. Removes the disk dependency; metadata-only files still
return null source.
@csharp36 csharp36 force-pushed the fix/phase0-source-code-null branch from cd0b916 to 9e8cae2 Compare May 29, 2026 20:23
@csharp36 csharp36 merged commit 795d43f into main May 29, 2026
1 check passed
@csharp36 csharp36 deleted the fix/phase0-source-code-null branch May 29, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant