Summary
Issue #2390 identified that codegraph roles --role <X> conflates "the graph has no classified symbols at all" with "this filter matched nothing," and recommended auditing other count === 0/.length === 0 branches in src/presentation/queries-cli/ for the same conflation. This is one of them.
Root cause
src/presentation/queries-cli/exports.ts:155 (inside fileExports):
if (data.results.length === 0 && !hasReexported) {
if (opts.unused) {
console.log(`No unused exports found for "${file}".`);
} else {
console.log(`No exported symbols found for "${file}". Run "codegraph build" first.`);
}
return;
}
A file can legitimately have zero top-level exports (e.g. an entry script, a side-effect-only module, a file that only re-exports via export * counted separately as reexportedSymbols) on a fully and correctly built graph. Recommending a rebuild in that case is misleading in the same way #2390 documented for roles --role.
Suggested fix
Distinguish "this file has no exports" from "this file/graph looks unbuilt" — e.g. only suggest codegraph build when the file itself has zero nodes in the graph at all (never parsed / not found), and otherwise say something like:
No exported symbols found for "<file>".
without the rebuild suggestion, mirroring the fix applied to roles --role in #2390.
Scope note
Filed separately per CLAUDE.md's scope-discipline rule — found while fixing #2390, kept out of that PR to preserve one-concern-per-PR.
Summary
Issue #2390 identified that
codegraph roles --role <X>conflates "the graph has no classified symbols at all" with "this filter matched nothing," and recommended auditing othercount === 0/.length === 0branches insrc/presentation/queries-cli/for the same conflation. This is one of them.Root cause
src/presentation/queries-cli/exports.ts:155(insidefileExports):A file can legitimately have zero top-level exports (e.g. an entry script, a side-effect-only module, a file that only re-exports via
export *counted separately asreexportedSymbols) on a fully and correctly built graph. Recommending a rebuild in that case is misleading in the same way #2390 documented forroles --role.Suggested fix
Distinguish "this file has no exports" from "this file/graph looks unbuilt" — e.g. only suggest
codegraph buildwhen the file itself has zero nodes in the graph at all (never parsed / not found), and otherwise say something like:without the rebuild suggestion, mirroring the fix applied to
roles --rolein #2390.Scope note
Filed separately per CLAUDE.md's scope-discipline rule — found while fixing #2390, kept out of that PR to preserve one-concern-per-PR.