Skip to content

Complete Axum route extraction and route visualization - #232

Merged
forhappy merged 3 commits into
mainfrom
codex/complete-axum-route-extraction
Aug 13, 2026
Merged

Complete Axum route extraction and route visualization#232
forhappy merged 3 commits into
mainfrom
codex/complete-axum-route-extraction

Conversation

@forhappy

Copy link
Copy Markdown
Contributor

Summary

  • compose Axum routers across local variables, nest/merge chains, uniquely resolved cross-module factory calls, and direct factory returns
  • extract state-wrapped handlers plus ordered layer/route_layer middleware with import-aware targets
  • fail closed for ambiguous module candidates and cyclic router factories, with explicit depth and expansion limits
  • render the Routes and handlers lens hierarchically and minimally qualify duplicate handler labels
  • advance extraction semantics to v10, regenerate the embedded viewer, and document the supported behavior

Root cause

Axum extraction previously understood only routes and prefixes visible in one inline builder expression. Router ownership was lost when a child router moved through a local variable or module factory, so nested prefixes and middleware never reached its routes. The workbench then forced every artifact lens onto the square grid and displayed terminal handler names, making distinct handler() targets overlap.

Impact

A clean qualification run against EpicGames/lore now publishes the production health, repository-content, presigned, authentication, and tracing flow. Its route lens increased from the four relationships in the reported export to 19 exact route relationships, with complete composed URLs and distinct handler labels.

Dynamic paths or runtime-selected factories remain unresolved; ambiguous and recursive structural compositions intentionally remain local rather than being guessed.

Validation

  • cargo fmt --all -- --check
  • cargo clippy --workspace --lib --bins --locked -- -D warnings
  • cargo test --workspace --lib --bins --locked
  • cargo test -p compass-resolve --test native_routes --locked
  • cargo test -p compass-output lenses --locked
  • npm run typecheck:js
  • npm run test:js (184 viewer, 120 VS Code, and 80 browser tests)
  • node scripts/check_viewer_assets.mjs
  • ./scripts/qualify_code_graph_v1.sh --fixtures-only (27 flows, 24 negatives, deterministic clean/warm/rebuild/alternate-checkout equality)
  • fresh code-only extraction of 944 files from EpicGames/lore, followed by a Routes and handlers workbench export

…oute-extraction

# Conflicts:
#	CHANGELOG.md
#	crates/compass-output/assets/viewer/graph.js
#	crates/compass-output/assets/viewer/manifest.json
#	packages/compass-viewer/src/workbench/VisualizationWorkbench.test.tsx
@forhappy
forhappy marked this pull request as ready for review August 13, 2026 06:10
@forhappy
forhappy merged commit 5cb00de into main Aug 13, 2026
14 checks passed
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