refactor: sweep dead-code cluster — unused Graph query API, vestigial installers, orphaned helpers (BE-4354) - #593
Conversation
… StandalonePython installers, orphaned helpers (BE-4354) Delete zero-reference symbols verified by word-boundary grep over the repo: - cql/engine.py Graph: pack_nodes, label_nodes, cloud_disabled_nodes, api_nodes, output_nodes, known_labels (kept cloud_enabled_nodes/packs/ downstream/find_paths) - standalone.py: install_comfy_cli, install_comfy (+ run_comfy_cli, orphaned once install_comfy went) - cmdline.py: validate_comfyui + commented-out scan_dir TODO block - update.py: get_version_from_pyproject (+ now-unused metadata import) - ui.py: prompt_autocomplete - utils.py: install_conda_package (+ now-unused subprocess/typer/rprint imports) - env_checker.py: EnvChecker.is_isolated_env - cql/errors.py: CQLRuntimeError.as_details
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
🔍 Cursor Review — Consolidated panel
Triggered by @mattmillerai.
✅ No high-signal findings.
Panel: 6/8 reviewers contributed findings.
Reviewers that did not contribute: kimi-k2.5:adversarial (empty), kimi-k2.5:edge-case (empty)
|
This PR currently conflicts with Please rebase (or merge |
…e-sweep # Conflicts: # comfy_cli/cmdline.py
bigcat88
left a comment
There was a problem hiding this comment.
Approving. A 15-symbol deletion across 8 modules is exactly where a missed reference hides — #598 is currently blocked for precisely that (it removed _LOADER_OPENER while a test file added later still named it), so I checked this one four independent ways rather than trusting a grep.
Nothing dangles
An AST sweep of every .py in the repo on this branch merged with current main, collecting definitions, Name/Attribute references, imports, and string constants matching each deleted name:
symbol defs-remaining references-remaining
api_nodes 0 0
as_details 0 0
cloud_disabled_nodes 0 0
get_version_from_pyproject 0 0
install_comfy 0 0
install_comfy_cli 0 0
install_conda_package 0 0
is_isolated_env 0 0
known_labels 0 0
label_nodes 0 0
output_nodes 0 0
pack_nodes 0 0
prompt_autocomplete 0 0
run_comfy_cli 0 0
validate_comfyui 0 0
Zero references and zero definitions for all fifteen — the string-constant column is what would have caught dynamic dispatch, and it's empty. There's also no getattr( anywhere in the eight touched modules, so nothing can reach them by name at runtime.
Non-Python files are clean too — no hits in *.md, *.toml, *.yml, *.json, *.cfg, *.txt.
Runtime smoke test
Every command whose module was touched still works, and all eight modules import:
comfy --help / env / standalone --help / update --help / validate --help / node --help / which
-> all exit 0, zero tracebacks
comfy_cli.{cmdline, cql.engine, cql.errors, env_checker, standalone, ui, update, utils}
-> all import OK
comfy standalone mattered most here, since install_comfy, install_comfy_cli, run_comfy_cli, install_conda_package and validate_comfyui all read like live installer helpers. They aren't.
The one deletion I wanted to check by hand
prompt_autocomplete is the only removal that lives on a path --help can't reach. It turns out to be a questionary single-select prompt helper, not shell-completion machinery — and real Typer completion still resolves fine on this branch:
_COMFY_COMPLETE=complete_fish ... -> rc=0, 41 completion entries
Public surface unchanged
cql/__init__.py's __all__ is ["CQLRuntimeError", "load_graph"] on both main and this branch, and none of the deleted Graph query methods (api_nodes, output_nodes, pack_nodes, label_nodes, known_labels, cloud_disabled_nodes) or as_details ever appeared there. So this is genuinely internal dead weight, not an API removal.
Full suite green on this branch merged with current main; ruff check + ruff format --diff clean under the CI-pinned 0.15.15.
Git history keeps all of it if the CQL query API is ever wanted back — that's the right trade for ~100 lines nothing calls.
ELI-5
Some code in comfy-cli was written but never actually used anywhere — a handful of
query helpers on the CQL
Graph, two installer methods, a couple of module-levelhelper functions, and a commented-out
TODOblock. Nothing calls them. This PRdeletes that dead code (~100 lines removed) so the codebase carries less unused
surface. Git history keeps it if it's ever wanted again.
What & why
Dead-code cluster sweep (BE-4354). Every deleted symbol was re-verified as
zero-reference by a word-boundary grep across the whole repo (
*.py,*.toml,*.md) immediately before deletion, andcql/engine.pywas confirmed to contain nogetattr/__getattr__dynamic dispatch that could reach the Graph methods.Deleted:
cql/engine.pyGraph:pack_nodes,label_nodes,cloud_disabled_nodes,api_nodes,output_nodes,known_labels. The live siblings(
cloud_enabled_nodes,packs,downstream,find_paths) are untouched.standalone.py:install_comfy_cli,install_comfy(both orphaned; theStandalonePythonclass stays live via other paths).cmdline.py:validate_comfyui(plain function, no decorator, no callers) andthe commented-out
scan_dir# TODO: Move this to proper placeblock.update.py:get_version_from_pyproject.ui.py:prompt_autocomplete.utils.py:install_conda_package.env_checker.py:EnvChecker.is_isolated_env(get_isolated_envstays).cql/errors.py:CQLRuntimeError.as_details.Judgment calls (consequential cleanups beyond the ticket's literal list)
To keep the tree lint-clean and free of code my own deletions orphaned:
standalone.pyrun_comfy_cli— its only caller was the deletedinstall_comfy,so it became zero-reference; removed it too.
update.pyfrom importlib.metadata import metadata;utils.pysubprocess,typer, and therprint as printshim — each was usedonly by a function deleted here.
ruff checkon the changed files passes with theseremoved.
Testing
ruff check+ruff format --checkon all changed files: clean. (The 16pre-existing
UP038errors in the untouchedworkflow_to_api.pyare unrelated tothis PR.)
uv run --extra dev pytest -q→ 2769 passed, 37 skipped (exit 0).Note on the negative-claim/falsification check: this is a pure deletion of unused
code. No user-reachable capability is denied — the removed symbols had zero call sites,
so no product path invoked them.