Repository navigation
Open
Description
Environment
- graphifyy: PyPI
graphifyy(CLIgraphify); version pinned at time of report e.g. 0.5.x - Python: 3.10+
- Corpus: Large multi-root workspace: multiple Frappe benches (same app names under different roots), frappe / erpnext trees, and generated assets under
sites/assets/(including*.min.js). - Command:
graphify update .from repository root
Problem
For this corpus shape, the defaults for explain, graphify query, and graphify path are easy to misread:
explain "<label>"often attaches to the wrong node for short or overloaded names — e.g. symbols inside minifiedsites/assets/**/*.min.js, or a test class before theDocumentcontroller for the same name.query(BFS) surfaces high-degree framework hubs (get,get_doc,Document, ERPNext-heavy nodes) before app-specific nodes unless--budgetis very large.path "A" "B"often returns no path for informal strings; disambiguation is needed when the same relative path exists under multiple bench roots.
graph.json itself still contains the right per-file nodes and many EXTRACTED edges; the pain is mostly resolution / traversal ergonomics and signal-to-noise at the CLI, not “missing data” in the graph.
Workarounds (already supported — README)
These reduce noise before any new flags:
.graphifyignore(gitignore-style) — e.g.**/sites/assets/,**/*.min.js; optionally excludefrappe//erpnext/when analysis targets custom apps only.- Narrow scan root —
graphify update <subdir>(e.g. onefrappe-bench/apps/tree). merge-graphs— combine smaller graphs when a single full-root graph is too hub-heavy.
This issue is for cases where teams still want a wide index or need better disambiguation without hand-editing graph.json.
Proposal
| Idea | Rationale |
|---|---|
explain --file <path> [--line N] and/or top-k matches (each with source_file, line, node id) |
Avoids a single silent wrong match; matches how power users already use stable ids from graph.json. |
query --seed-file <path> or --path-prefix <prefix> |
Starts BFS from nodes under a subtree (one bench / one app), reducing hub flooding. |
| Optional deprioritization of certain paths as match / seed candidates (not only via ignore) | For corpora that must include sites/assets but should not prefer minified bundles when resolving validate / get_doc. |
Suggested acceptance (future behavior)
- With
explain --file(or equivalent) set to a known controller, resolution for a short name likevalidateshould not prefer an unrelated*.min.jssymbol in that disambiguated context. explain DataSyncConfiguration-style input should return multiple candidates (e.g. test vsDocument) with fullsource_file, not pick one arbitrarily.
Related
- Cross-file INFERRED
callsresolution lacks import evidence + ambiguous-candidate handling — short common names blow up god_nodes ranking #543 — INFERRED cross-filecalls/ global name map; short names and god_nodes inflation (overlapping theme: ambiguous short names). - README —
.graphifyignore,merge-graphs,query/path/explainexamples.
Happy to help validate a PR or share a minimal public repro corpus description if useful.
Metadata
Metadata
Assignees
Labels
No labels
Activity
[-]RFC: Improve explain/query/path resolution for large monorepos (minified JS, duplicate paths, hub bias)[/-][+]Feature request: scoped resolution for explain/query/path (monorepos, minified bundles, name collisions)[/+]