Repository navigation
Description
Summary
graphify extracts AST import edges for some JS/MJS files in a corpus but silently skips them for others, producing misleading degree-0 "orphan" nodes.
Repro
Run /graphify . on a Node.js repo containing:
File A: backend/api/src/seed/run-seed.mjs — 9 explicit relative imports:
import mongoose from "mongoose";
import { CandidateModel } from "../models/candidate.model.mjs";
import { SessionModel } from "../models/session.model.mjs";
import { DecisionModel } from "../models/decision.model.mjs";
import { FeedbackModel } from "../models/feedback.model.mjs";
import { candidateSeeds } from "./prototype/candidates.seed.mjs";
import { sessionSeeds } from "./prototype/sessions.seed.mjs";
import { decisionSeeds } from "./prototype/decisions.seed.mjs";
import { feedbackSeeds } from "./prototype/feedback.seed.mjs";Observed edges for run-seed.mjs:
run-seed.mjs --contains--> run()(intra-file)runPrototypeSeed() --calls--> run()(intra-file)- Zero
imports_fromedges.
All 8 target files exist as nodes in the same graph (they appear in community listings with their own stems), so this isn't a missing-corpus issue.
Counter-example in the same run: backend/api/src/models/enums.mjs is an exports-only file, and the graph correctly shows cross-file edges between it and decision.model.mjs / candidate.model.mjs (resolved via those model files importing ../enums.mjs). So the import resolver handles some ../sibling.mjs cases, just not consistently.
Expected
Each relative import ... from "./foo" or "../foo" statement should produce an imports_from edge whenever the target file is present in the corpus.
Impact
feedback.model.mjs and session.model.mjs appear as degree-0 orphans in GRAPH_REPORT.md despite being actively imported from run-seed.mjs. This inflates the weakly-connected-nodes count and breaks reverse-lookup queries like "which files use session.model.mjs?"
Environment
- graphifyy 0.4.18 (via pipx)
- Python 3.12.3 on Ubuntu-based Linux (kernel 6.17)
- Invocation:
/graphify .via the Claude Code skill, default pipeline - Corpus: 75 files (27 code, 45 docs, 3 images)
Happy to share the full graph.json or construct a minimal repro repo if useful.
Activity
Fix 5 issues: .mjs import edges (Graphify-Labs#414), cache root path (G…
v0.4.20: fix #414 JS imports_from path normalisation, fix #418 graph.…
v0.4.20: fix Graphify-Labs#414 JS imports_from path normalisation, fix …