Skip to content

fill: list the open call sites the project may own and settle them in batches (#1835) - #2028

Merged
swapnilpaliwal-sd merged 6 commits into
0.2.4from
feat/fill-unresolved
Nov 19, 2026
Merged

swapnilpaliwal-sd merged 6 commits into
0.2.4from
feat/fill-unresolved

Conversation

@swapnilpaliwal-sd

@swapnilpaliwal-sd swapnilpaliwal-sd commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1835

By the end of a build the engine has resolved what it can. The call sites it leaves are calls through a value (a handler table, a callback parameter, getattr, reflection) or a member called on a receiver it could not type. An answer listed the sites it stopped at, but nothing listed them all, and nothing told the agent to look. This adds a fill pass: after a build, the agent is told how many sites are open and settles them by reading the code. Links are validated by the same rules as link, and each one is recorded as [asserted], never as resolved.

What changes

  • axiomcode unresolved and the MCP tool unresolved(limit, decisions): a summary line, then the open sites inside the most called callers first. Each site comes with its code, the engine's reason and its candidates. decisions takes one line per site and answers with what was taken plus the next page:
    • <site> <target> links the site;
    • <site> not:<target> rejects a lead;
    • <site> ? leaves the site open.
  • Only sites that may land in the project are listed. A member call needs a project method of that name; a bare call through a value counts unless the file imports the name. A library's method on an untyped value (text.strip(), path.exists()) is counted, not listed.
  • link --batch - applies many decisions at once, validating each like a single link. A ? or a rejection is kept in .axiomcode/fill-skipped.tsv, keyed by the line's text, so the site comes back only when its line changes.
  • The build prints the summary line, just above its last line, graph at <path>. The first prompt after a build (a hook, on every supported host) and the first MCP query answer (for hosts without hooks) say how many sites are open and how to fill them. Each says it once per build.
  • Skill fill (/axiomcode:fill): runs in a forked subagent where the host supports it, links only what the code makes certain, and returns one line.
  • Also fixed: subprocess.run(..), asyncio.run(..) and child_process.exec(..) matched the reflective names, so every answer listed them under "to resolve" as running a value. A call on a process or event-loop module, including through an import alias, no longer counts. Method.invoke, Function.apply and Thread.run still do.

Measured

On a 70k-line Python project (one Python graph, built from a scratch copy):

sites
call sites 22,824
unresolved 5,333
a library's method on an untyped value 5,253 (98.5%)
may land in the project 80
  • The filter drops nothing real. I read a random sample of 30 sites from the library bucket, and all 30 were library calls: dict.get, str.strip, Path.exists, argparse and a third-party library's methods.
  • One headless agent run of /axiomcode:fill settled all 81 open sites (before the process-launcher fix, there was one more): $0.51, 69 s.
Agent decision Sites Checked by reading the code
Linked 16 16 of 16 correct
Lead rejected 45 5 sampled, 5 correct
Left open 25 not checked

The links were callbacks returned as a tuple from a factory, a function chosen by a conditional (two links), and a predicate passed in as a parameter. impact now walks them.

  • Cost: the worklist takes 0.4 s on that graph. A query answer starts no extra process once the build has been announced.

On a 400-file TypeScript monorepo (one TypeScript graph, from a scratch copy):

sites
call sites 19,461
unresolved 14,701
a library's method or a runtime global 11,699 (79.6%)
may land in the project 3,002
  • The filter drops nothing real here either. I read a random sample of 25 sites from the library bucket, and all 25 were library calls: the test runner, the schema library, React, JSON, string methods.
  • The TypeScript run turned up gaps in the filter, now fixed:
    • bare calls are FUNCTION_CALL there, not SIMPLE_CALL;
    • imports often span lines;
    • test-runner globals are used without an import;
    • a monorepo imports its own workspace packages by bare name.
  • One headless /axiomcode:fill run worked through 8 pages (the skill's budget): $1.50, 4 min.
Agent decision Sites Checked by reading the code
Linked 127 all 25 distinct patterns correct, so all 127 links
Lead rejected 93 11 sampled; 9 clearly correct (React.useContext, Headers.get, Set.add, Promise.resolve, ...), 2 plausible
Left open 50 not checked

2,779 sites remain open for later passes. The links:

  • Factory return values: a method assigned from a factory → the inner function the factory returns.
  • Proxy dispatch: a call through a Proxy → the handler-table entry it dispatches to.
  • Destructured context hooks: a hook destructured from a context object → the function that created it.
  • Wrapped callbacks: a stored callback → the wrapper registered for it.

Tests

  • tests/fill.py (new, 28 checks):
    • library vs project, both directions;
    • the build prints the summary line and still ends with graph at;
    • batch links, refusals, ? and rejection skips;
    • an edit re-opens a skipped site;
    • the notice once per build, per surface.
  • tests/surfaces.py, tests/mcp.py, tests/mcp_docs.py, tests/front_door.py: unresolved is a public verb and an MCP tool with two parameters; link keeps two.
  • tests/hosts.py: the fill hook answers in each supported host's hook output shape.
  • tests/manifests.py: AGENTS.md names unresolved, and the Gemini and Cursor copies are regenerated.
  • tests/hooks_from_path.py and tests/mcp_first.py pass unchanged.
  • tests/surfaces.py still reports README.md CLI section: names the flag --fresh. That failure is already on dev; this PR does not touch the README.

… keeps its own version)

0.2.3 is released, so what merges into this branch ships in 0.2.4. package.json (version and the five @axiomcode/engine-* pins) and the four editor plugin and extension manifests move from 0.2.3 to 0.2.4. The parser keeps its own version.
…m in batches, and say so once per build

The engine has done what it can by the end of a build; the sites it leaves are calls through a value (a handler
table, a callback parameter, getattr, reflection) or a member called on a receiver it could not type. An answer listed
the ones it stopped at; nothing listed them all, and nothing told the agent to look.

- `axiomcode unresolved` / MCP `unresolved(limit, decisions)`: a summary line, then the open sites inside the most
  called callers first, each with its code, the engine's reason and its candidates. Only sites that may land in the
  project are listed: a member call needs a project method of that name, a bare call through a value counts unless
  the file imports the name. A library's method on an untyped value is counted, not listed.
- `link --batch -`: links, rejected leads (`not:`) and `?` (read, nothing certain) in one apply, each validated as a
  single link is. A `?` or a rejection is kept in .axiomcode/fill-skipped.tsv keyed by the line's text, so the site is
  asked again only when its line changes.
- the build ends with the summary line; the first prompt (hook) and the first query answer (MCP, for hosts without
  hooks) after a build say how many sites are open and how to fill them, once per build.
- skill `fill` (`/axiomcode:fill`), forked into a subagent where the host supports it: read each site, link only what
  the code makes certain, return one line.
… import is a package's name

- `subprocess.run(cmd)`, `asyncio.run(..)`, `child_process.exec(..)` matched the reflective names (`run`, `exec`) and
  every answer listed them under "to resolve" as running a value. A call written on a process or event-loop module,
  read through an import alias (`import a as b, subprocess as sp`, `import * as cp from 'child_process'`), is no
  longer one. Method.invoke, Function.apply and Thread.run still are.
- a JS/TS `import { z } from 'zod'` line was read by the Python import rule, so its names were never taken as a
  package's and a bare call of one was listed as a call through a value; a relative import is still the project's own.
@swapnilpaliwal-sd swapnilpaliwal-sd added enhancement New feature or request plugin the axiomcode plugin: skill + MCP layer skill Agent-facing query skill (skills/axiomcode) mcp the MCP layer of the plugin python Python typescript TypeScript labels Nov 18, 2026
…als and workspace packages

Measured on a TypeScript monorepo, the fill list dropped every call through a local value there: the bare-call kinds
were Python's only. And it kept what is not the project's:

- a bare call is FUNCTION_CALL / JSX_COMPONENT_CALL in TypeScript and JavaScript and INVOCATION / DELEGATE_INVOKE in
  C#, not only SIMPLE_CALL (`const { useWidget } = ctx; useWidget()` was filed as a library's)
- an import whose braces span lines (`import {\n  expectTypeOf,\n} from 'vitest'`) is read; the reader is bounded, so a
  Python file's `import` lines cannot make it scan the whole file (a 120 s worklist on a 70k-line project before)
- a runtime or test-runner global (`fetch`, `expect`, `expectTypeOf`, `assert`) is the platform's, unless the file
  imports the project's own declaration of that name from a relative path or a workspace package
- an import from one of the repository's own workspace packages (a monorepo's `@scope/core`) is the project's
- a bare call reaches functions, classes, consts and variables, never a method; a call on a receiver reaches methods
…olved

The summary line was printed after `graph at <path>`, which callers read as the build's last line
(tests/publish_order.py's one-language control). It now prints just above the warnings and that line.

AGENTS.md lists the unresolved tool, and the Gemini skill copy and the Cursor rule are regenerated
with packaging/copies.py (tests/manifests.py).
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit c079bfa into 0.2.4 Nov 19, 2026
13 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the feat/fill-unresolved branch November 19, 2026 04:30
@swapnilpaliwal-sd swapnilpaliwal-sd mentioned this pull request Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request mcp the MCP layer of the plugin plugin the axiomcode plugin: skill + MCP layer python Python skill Agent-facing query skill (skills/axiomcode) typescript TypeScript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant