Skip to content

fix: suppress misleading RelationshipCount in local mode CriticalFiles#301

Merged
claude[bot] merged 1 commit intomainfrom
claude/issue-299-20260228-2111
Feb 28, 2026
Merged

fix: suppress misleading RelationshipCount in local mode CriticalFiles#301
claude[bot] merged 1 commit intomainfrom
claude/issue-299-20260228-2111

Conversation

@claude
Copy link
Contributor

@claude claude bot commented Feb 28, 2026

Problem

In local mode, computeTopFiles always produced RelationshipCount = 1 for every file because files are grouped by top-level directory — each file belongs to exactly one domain. The template then rendered cmd/run.go — 1 relationships for every entry, which was noise rather than signal.

Changes

internal/local/local.gocomputeTopFiles

  • Sets RelationshipCount = 0 for all local-mode files (suppresses the count in output)
  • Removes the domain co-occurrence counting loop (always gave 1, meaningless)
  • Adds a simple importance heuristic for ranking:
    • Well-known entry-point names (main, app, server, index, init) score higher
    • Shorter paths (closer to root) rank above deeper paths
    • Alphabetical as tiebreaker
  • Adds entryPointPriority helper

internal/template/render.go — template + truncated renderer

  • Template: skips — N relationships when RelationshipCount is 0
  • truncateToTokenBudget: same — omits the count when it is 0

Fixes #299

Generated with Claude Code

In local mode, computeTopFiles always produced RelationshipCount=1 for every
file because files are grouped by top-level directory (each belongs to exactly
one domain). This made the "N relationships" label noise rather than signal.

Changes:
- computeTopFiles now sets RelationshipCount=0 for all local-mode files
- Files are ranked by a heuristic: well-known entry points (main, app, server,
  index, init) score higher; then shorter paths (closer to root); then alpha
- Template skips "— N relationships" when RelationshipCount is 0
- truncateToTokenBudget likewise omits the count when it is 0

Co-Authored-By: Grey Newell <greyshipscode@gmail.com>
Co-Authored-By: claude[bot] <claude[bot]@users.noreply.github.com>
@claude claude bot merged commit c7b6d8c into main Feb 28, 2026
1 check passed
@claude claude bot deleted the claude/issue-299-20260228-2111 branch February 28, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: local mode CriticalFiles always shows "1 relationships" — misleading output

0 participants