Skip to content

feat(architecture): warn when --limit cuts a probed symbol's callees - #42

Merged
inth3shadows merged 1 commit into
masterfrom
arch-limit-truncation-warning
Sep 27, 2026
Merged

inth3shadows merged 1 commit into
masterfrom
arch-limit-truncation-warning

Conversation

@inth3shadows

Copy link
Copy Markdown
Owner

Follow-up (c) from #39's review.

--architecture ignored truncation, so file edges cut by --limit disappeared with no warning.

  • probeSymbolCallees returns truncated, read by readTruncation from the slice it actually answered with: the matched definition's own truncated, else the response's, else the hit-the-limit heuristic (npm). The node -f trail is never flagged: it has no --limit, and parseNodeCalls already refuses a trail cut at 12.
  • probeFileEdges collects those names; architectureTruncationWarning prints one aggregated stderr line, like diffTruncationWarning.
  • README and TECHNICAL.md document it (and TECHNICAL.md no longer calls probeFileEdges unexported).

Real run on this repo at the default --limit 50: warns for the callgraph.js file node, which has 57 callees (total: 57, truncated: true). So docs/architecture.svg has been missing some of that file's edges. This PR does not regenerate it.

Local: node test/run.js 180 passed, 0 failed (fork codegraph).

--architecture ignored truncation, so edges cut by --limit vanished
silently. probeSymbolCallees now reports truncated for the slice it
answered with (via readTruncation), probeFileEdges collects those names,
and architectureTruncationWarning prints one aggregated stderr line.
The node -f trail is never flagged: it has no --limit.
@inth3shadows
inth3shadows merged commit 9d9685d into master Sep 27, 2026
7 checks passed
@inth3shadows
inth3shadows deleted the arch-limit-truncation-warning branch September 27, 2026 01:31
inth3shadows added a commit that referenced this pull request Sep 27, 2026
The warning added in #42 flagged this repo's own diagram: at the default
`--limit 50`, `test/run.js` (60 callees) and `render/callgraph.js` (57)
were cut off.

- `docs/architecture.svg` regenerated at `--limit 100`: the `test/run.js
→ render/callgraph.js` edge goes from 29 to 55.
- CI's architecture `--check` step and TECHNICAL.md's regenerate command
pass the same `--limit 100`, so they stay the same command.

Note: `--check` compares nodes and edges, not weight labels
(`svgStructure`, by design), so CI passes with or without this and never
caught the 29.

Local: the new `--check` command exits 0 ("up to date").
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.

1 participant