refactor(resolution): extract build() passes + move Rust FQN tier behind the post_process seam#652
Merged
Merged
Conversation
…ions GraphBuilder::build() was 1252 lines with pass boundaries that existed only as comments. Extracts Pass 1.5 (Route extraction), 1.6 (fetch-shape extraction), 1.7 (entry-point scoring), and 1.8 (FunctionMeta collection) into named module-level functions with narrow parameters, mirroring the existing pass2_emit_node_edges / pass2_emit_framework_and_fanout pattern. build() drops from ~1252 to ~1204 lines and reads as an orchestrator for these passes plus Pass 2 / Pass 3 / Pass 4. Pure code motion — bodies are unchanged except for borrow/parameter plumbing (e.g. self.repo_root.as_ref() -> repo_root.as_deref() at the narrower function boundary). Pass order is unchanged.
coseto6125
enabled auto-merge (squash)
July 22, 2026 17:46
Contributor
ecp impact cache (0 symbols) — internal, used by
|
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.
What
Extracts Pass 1.5 (Route extraction), 1.6 (fetch-shape extraction), 1.7
(entry-point scoring), and 1.8 (FunctionMeta collection) out of
GraphBuilder::build()into named module-level functions with narrowparameters, mirroring the existing
pass2_emit_node_edges/pass2_emit_framework_and_fanoutpattern already in this file.build()drops from ~1252 lines to ~1204 lines and now reads as anorchestrator calling
pass1_5_extract_routes->pass1_6_fetch_shapes->
pass1_7_entry_points->pass1_8_function_metas-> Pass 2 -> Pass 3-> Pass 4, instead of having pass boundaries that existed only as
comments.
Why
build()was a single 1252-line function; the four Pass-1.x blocks eachhad a clean, narrow dependency surface (read
local_graphs+ some priorpass's output, write into
nodes/string_pool/ an owned accumulator)that made them straightforward to cut without touching control flow.
Scope note: Tier 3.5 (Rust FQN) was NOT moved
The originating review described Tier 3.5 as "~250 lines of Rust-only
crate::a::b::fnFQN resolution inlined directly inbuild(), bypassingthe post_process seam." That description does not match the code as it
exists on
main: the actual FQN resolution machinery already livescleanly in
crates/ecp-analyzer/src/rust/module_tree.rs(
RustWorkspaceModTree, 1113 lines) and is consumed throughResolver::with_mod_tree(). What sits inline inbuild()is ~10 linesof
mod_tree_optconstruction plus wiring it into the serial/parallelPass 2 resolvers — already about as thin as a call site gets. There is no
250-line inlined block to extract, and no
post_process-style seam toretrofit here without manufacturing indirection that doesn't correspond
to anything in the code. This part of the task is skipped as based on a
stale premise; flagging it explicitly rather than silently dropping it.
Verification (zero behavior change)
cargo test -p ecp-analyzer --tests: 2512 passed, 0 failedcargo test -p egent-code-plexus --tests: 1249 passed, 0 failedcargo clippy -p ecp-analyzer --tests: cleancargo clippy -p egent-code-plexus --tests: cleanrustfmt --edition 2021on the touched file: no changes neededdropped statements, no reordered side effects across pass boundaries.