Skip to content

refactor(resolution): extract build() passes + move Rust FQN tier behind the post_process seam#652

Merged
coseto6125 merged 1 commit into
mainfrom
chore/resolution-pass-extract
Jul 22, 2026
Merged

refactor(resolution): extract build() passes + move Rust FQN tier behind the post_process seam#652
coseto6125 merged 1 commit into
mainfrom
chore/resolution-pass-extract

Conversation

@coseto6125

Copy link
Copy Markdown
Owner

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 narrow
parameters, mirroring the existing pass2_emit_node_edges /
pass2_emit_framework_and_fanout pattern already in this file.

build() drops from ~1252 lines to ~1204 lines and now reads as an
orchestrator 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 each
had a clean, narrow dependency surface (read local_graphs + some prior
pass'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::fn FQN resolution inlined directly in build(), bypassing
the post_process seam." That description does not match the code as it
exists on main: the actual FQN resolution machinery already lives
cleanly in crates/ecp-analyzer/src/rust/module_tree.rs
(RustWorkspaceModTree, 1113 lines) and is consumed through
Resolver::with_mod_tree(). What sits inline in build() is ~10 lines
of mod_tree_opt construction plus wiring it into the serial/parallel
Pass 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 to
retrofit 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 failed
  • cargo test -p egent-code-plexus --tests: 1249 passed, 0 failed
  • cargo clippy -p ecp-analyzer --tests: clean
  • cargo clippy -p egent-code-plexus --tests: clean
  • rustfmt --edition 2021 on the touched file: no changes needed
  • Diff reviewed end-to-end: pure code motion, pass order unchanged, no
    dropped statements, no reordered side effects across pass boundaries.

…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
coseto6125 enabled auto-merge (squash) July 22, 2026 17:46
@coseto6125 coseto6125 added the merge-queue Opt-in to Mergify merge queue label Jul 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor
ecp impact cache (0 symbols) — internal, used by ecp dev pr-analyze

[]

@github-actions github-actions Bot added the ecp:risk-low ecp signal label Jul 22, 2026
@coseto6125
coseto6125 merged commit 703eb1d into main Jul 22, 2026
18 checks passed
@coseto6125
coseto6125 deleted the chore/resolution-pass-extract branch July 22, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ecp:risk-low ecp signal merge-queue Opt-in to Mergify merge queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant