Skip to content

context: interface for bounding and continuing the walk (no behavior change) - #2033

Open
Ayingxizhao wants to merge 1 commit into
AxiomCodeAI:devfrom
Ayingxizhao:feat/context-interface
Open

Ayingxizhao wants to merge 1 commit into
AxiomCodeAI:devfrom
Ayingxizhao:feat/context-interface

Conversation

@Ayingxizhao

Copy link
Copy Markdown
Contributor

What changed

The interface for bounding and continuing a context walk. No traversal logic changes: a call that leaves the new
inputs out builds the same CLI command as before and gets the same answer.

MCP input CLI flag State
start_symbol --from (exists) works
token_budget --page-budget (exists) works
direction (callers / callees / both) --direction (new) checked, not yet used by the walk
max_depth --depth (new for context) checked, not yet used by the walk
expand_context(continuation_id, branch) --continue, --branch (new) refused: not implemented yet
  • mcp/server.py: the new inputs and tool. Bad values are refused as tool errors in the tool's own words, because
    the CLI's refusal names its flag and plain() drops that clause. The new flags are added to VALUED and
    _CLI_OPTIONS.
  • axiomcode-context: parses and checks the new flags. Before, an unknown flag was read as task words.
    --json gains depth_reached, stop_reason, branches_remaining, continuation_id, unresolved, omitted,
    all null (not computed yet), never an empty list that would read as "nothing omitted".
  • axiomcode launcher and ax_web.py: the new flags join the lists of flags that take a value, so
    --direction callers is not taken for the repository directory.
  • Tests: tests/mcp.py lets context take up to six parameters (MAX_PARAMS; every other tool keeps two);
    tests/surfaces.py lists expand_context as MCP-only, since it is context --continue and not a second verb;
    tests/mcp_docs.py and tests/front_door.py expect the new tool.
  • Docs: SKILL.md and AGENTS.md say which inputs work now and which are placeholders.

Why the goldens moved, or why they did not

No golden moved. Nothing under test/*/expected changed: this touches the query surface only, not the rules or
the parser.

Evidence

On a synthetic two-function project (a calls b):

  • the default context output is byte-identical to dev;
  • with direction='callers', max_depth=2 the answer is unchanged;
  • over MCP, direction='sideways', max_depth=-1 and expand_context('abc') are refused with isError and a
    message naming the parameter; an unknown argument is still refused.

Checklist

  • tests/mcp.py, tests/mcp_docs.py pass; tests/surfaces.py fails only on README.md CLI section: names the flag --fresh, which fails the same way on dev
  • tests/front_door.py: 21 of 21 hold
  • tests/run.py --lang python: 479 of 483 pass; the 4 failures (text-interpolated-phrase,
    text-when-the-graph-has-no-answer) fail the same way on dev
  • No golden moved
  • Validated over the CLI and over MCP (SDK and fallback servers)
  • Labels set

start_symbol and token_budget map to the existing --from and --page-budget;
direction and max_depth are checked but not yet used; expand_context is
refused as not implemented. With the new inputs left out, answers are unchanged.
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