Experiment A: refactor shared analyzer tree building - #6
Closed
jolestar wants to merge 1 commit into
Closed
Conversation
Contributor
Author
|
Closing in favor of #7. In the A/B comparison, Experiment B had the cleaner module boundary and lower token/round cost while passing verification. |
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
This is experiment A for #1: refactor the repeated analyzer tree-building logic while keeping the shared helper inside
src/analyzer.rs.The current project structure is small and layered:
src/main.rs: CLI entry point and argument handlingsrc/analyzer.rs: language dispatch and shared analyzer model helperssrc/rust.rs,src/javascript.rs,src/markdown.rs: language-specific tree-sitter extractionsrc/model.rs,src/render.rs,src/util.rs: shared data model, rendering, and utility codetests/fixtures/*: language fixture coverage used by the existing test suiteA/B analysis report
Goal: evaluate two implementations of issue #1 and compare the usefulness of the
sviewskill for navigating the refactor.Experiment A:
sviewskill enabledImplementation in this PR:
build_analyzer_treehelper insrc/analyzer.rs(parent, node)entriesObserved navigation characteristics:
sviewoutline pass plus targeted reads was enough to identify the repeated shape across analyzer modulesExperiment B: no
sviewskillComparison branch/PR uses a separate
src/tree.rsmodule for the shared helper.Observed navigation characteristics:
rg/sedexploration was also sufficient for this small repositoryRecommendation
Both implementations solve #1 and pass tests. I slightly prefer the B shape (
src/tree.rs) for long-term module boundaries, but this A PR is useful evidence thatsviewhelps an agent quickly understand the repository outline and repeated code structure.Verification
cargo fmt --checkcargo test --quiet