Repository navigation
Relative graph paths (schema v16) and parse each Python file with ast once - #1234
Closed
brijesh-neo wants to merge 2 commits into
Closed
brijesh-neo wants to merge 2 commits into
brijesh-neo wants to merge 2 commits into
Conversation
A graph.db copied into a linked worktree, fork or clone now answers with that checkout's paths. In-repo paths are stored as ./rel (the root as .), paths outside the root stay absolute, and values that would read as relative are escaped with !. Translation happens at the SQLite connection, so callers keep seeing absolute paths. - One-time copy-and-swap conversion of older graphs; other openers get a "try again" error while it runs. Rows that collide under two spellings of the root no longer end the copy early. - A copied graph's first update runs a full build, because extra JSON still names the checkout it was built in. - MCP tools take an optional cwd: inside the repository, result paths are repo-relative; otherwise they stay absolute. - doctor, embeddings, the import audit script and the incremental-fidelity benchmark decode stored paths. - VS Code extension reads both formats (SUPPORTED_SCHEMA_VERSION 16). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Function scopes, dead-branch calls and dead-branch imports each ran ast.parse on the same bytes. They now share one cached tree; none of them modifies it. Parsing this repository's 408 Python files goes from 9.3 s to 8.7 s with byte-identical output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Opened here by mistake; closing. |
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
Two changes, one commit each.
1. Store graph paths relative to the repository (schema v16). A
graph.dbcopied into a linked worktree, fork or clone now answers with that checkout's paths../rel(the root as.). Paths outside the root stay absolute, and values that would read as relative are escaped with!.extraJSON still names the checkout it was built in.cwd. Inside the repository, result paths are repo-relative; otherwise they stay absolute.doctor, embeddings, the import audit script and the incremental-fidelity benchmark decode stored paths.SUPPORTED_SCHEMA_VERSION16).2. Parse each Python file with
astonce instead of three times. Function scopes, dead-branch calls and dead-branch imports now share one cached tree. Parsing this repository's 408 Python files goes from 9.3 s to 8.7 s, with byte-identical output.Tests
tests/test_python_file_ast_parsed_once.py.ruffis clean.🤖 Generated with Claude Code