Fix #648: Wire TsconfigResolver in CLI commands#675
Conversation
|
✅ Health: 7.6 (unchanged) 📋 At a glance
🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)
🔎 More signals (3)🔥 Hotspots touched (5)
2 more
🔗 Hidden coupling (2 files)
💀 Dead code (1 finding)
📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-14 18:34 UTC |
|
The The blocker is the third site. A test that invokes the workspace path would catch this. The current regression test only exercises the helper on its own. Once that's fixed and green, this is ready. |
|
Thanks for tackling this @kishansaaai. The diagnosis is spot on and the shared-helper approach is exactly right. The dead_code_cmd.py wiring is correct. But as it stands the PR does not work yet. There are three blocking issues, and GitHub already flags the branch as conflicting.
assert graph_builder.graph.has_edge(layout_path, sensor_path) # AttributeError Both lines raise AttributeError: 'function' object has no attribute 'has_edge', so this test errors rather than validating the fix. Please change them to graph_builder.graph().has_edge(...) / graph_builder.graph().in_degree(...) and confirm it runs green.
Minor: there's some trailing whitespace on the blank lines inside the new helper's docstring/body worth cleaning up. For reference, I confirmed the scope is complete: dead_code, health, and workspace are the only three CLI paths that do an in-memory graph_builder.build(). update_cmd rehydrates from the DB and isn't affected. Suggested next steps: rebase on main, move the health wiring into health_cmd/command.py, drop the two kwargs from the workspace call, and fix the test's graph() call so it actually exercises the path. |
eb2c555 to
aed3f92
Compare
|
Summary The root cause was that Changes:
Related Issues Test Plan
Checklist
|
Summary
This PR fixes the false-positive
unreachable_filereports for TS/JS projects using path aliases (like@/components) in CLI commands.The root cause was that
TsconfigResolverwas only being wired up during the pipeline ingestion phase. Any CLI command that rebuilt the graph in-memory without this phase (such asdead-code,health, andworkspace) would fail to resolve aliases, leaving valid targets within_degree=0.Changes:
wire_tsconfig_resolverhelper function inrepowise.core.ingestion.tsconfig_resolver.repowise/core/pipeline/phases/ingestion.pyto use the shared helper.graph_builder.build()indead_code_cmd.py,health_cmd.py, andworkspace_cmd.py.Related Issues
Fixes #648
Test Plan
pytest)ruff check .)npm run build) (if frontend changes)Added a dedicated regression test (
test_tsconfig_cli_repro.py) that mimics the CLI command's in-memory graph rebuild with a mock@/*alias to ensure it properly connects to its target and suppresses the false unreachability finding.Checklist