Skip to content

impact, context: list the call sites of a name that is called but declared nowhere - #1810

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.9from
fix/called-but-undeclared
Sep 30, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.9from
fix/called-but-undeclared

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

Asked about a function the code calls but that is not written yet, impact counted the call sites but never said where they are:

`scale` as written at 1 unresolved call site(s)
directly touches it: nothing the graph can see
next: nothing resolved depends on it, so the change is local

The other surfaces missed them too:

  • --grep printed no rows.
  • context dropped the word, because only declared names reach its ranking.

When writing a function that is already called but not yet written, those call sites are what you need first. A text search finds them in one call, so an agent limited to the graph could not find them.

Change

  • impact: each unresolved call site of a name-matched target is now a direct row, e.g. [by name] Circle.area app/shapes.py:14 — calls it (no declaration of this name). It appears in the prose, --json and --grep output.
  • context: an identifier the task mentions that the code calls but nothing declares is now listed first, with its call sites and code lines (called_undeclared in --json). It is computed before anything that can end the answer early.
  • ax_grep: those call sites lead the grep-shaped context answer that the MCP tools return by default.

Tests

  • New case tests/cases/python/called-but-undeclared: 4/4 checks pass with this change, 2/4 on the base branch. The two controls, both on a declared function, pass on both.
  • Full tests/run.py: 1199/1209 checks pass. All 10 failures also fail identically on the base branch (5 cases, fixed separately).
  • Standalone suites: surfaces, mcp, mixed_separators, latency, directive, manifests, mcp_docs and cli_version all pass.

… call sites

Asked about a function that is called but not yet written, impact counted the sites ("`scale` as written at 1
unresolved call site(s)") and then answered "directly touches it: nothing" and "the change is local"; --grep printed
no rows; context dropped the word, since only declared names reach its ranking. Writing such a function starts from
exactly those sites, and a text search finds them in one call.

- impact: each unresolved call site of a name-matched (written) target is a direct row, [by name], "calls it (no
  declaration of this name)" at its file:line, so the prose, --json and --grep answers carry them.
- context: identifiers the task writes that the code calls and nothing declares are listed first, with their call
  sites and code lines (called_undeclared in --json), before anything that can stop the answer early.
- ax_grep: those sites lead the grep-shaped context answer the MCP tools return by default.

tests/cases/python/called-but-undeclared: 4/4 here, 2/4 on the base (the two controls, a declared function, pass on both).

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit a247fac into 0.1.9 Sep 30, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the fix/called-but-undeclared branch September 30, 2026 06:39
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