Skip to content

plugin: axiomcode value <name>, the current value of a named constant on the CLI and as an MCP tool (#1835) - #1961

Open
swapnilpaliwal-sd wants to merge 1 commit into
0.2.1from
fix/value-verb
Open

swapnilpaliwal-sd wants to merge 1 commit into
0.2.1from
fix/value-verb

Conversation

@swapnilpaliwal-sd

@swapnilpaliwal-sd swapnilpaliwal-sd commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1971

Part of #1835.

What

axiomcode value <name> reads a named constant's current value from the index: value, kind, and file:line with the source line. It is on the CLI and is also an MCP tool, value(name), beside context, impact, path, link and tests.

The literals table has stored each literal's value, kind and, for a named constant, its name since index v8. No verb read it, so "what is the current value of limit X?" could only be answered by querying graph.sqlite by hand.

Behaviour

  • An exact name is matched first, then every declaration whose last part matches. A name defined in several places is listed in full, with the count; none is picked.
  • Class.NAME answers for that member only. MAX_* and Pager.* list every match.
  • A name declared without a single literal value (initialized from a call, a dict or an object) prints its declaration line and says it has no literal value. A local says it is a local and where it is assigned. A function or type says it is not a constant. An unknown name says so and exits 1.
  • Each language's graph is queried on its own; no rows are joined across graphs.
  • It goes through the same freshness path as the other query verbs. --json prints one document.

Tests

  • tests/cases/{python,typescript}/value-verb: 10 checks each. Before the change: 0/20. After: 20/20. The control: a constant initialized through a call is reported with no value.
  • tests/run.py --lang python: 455/455. --lang typescript: 362/362.
  • surfaces.py, mcp.py, mcp_first.py (24/24), mcp_docs.py, manifests.py and repo_arg.py pass.
  • freshness.py passes 117/118. The one failure fails the same way on the untouched base.
  • This also fixes three checks that were failing on the base: mcp_docs.py had a stale tool list, surfaces.py failed because the README named --fresh, and manifests.py failed because one SKILL.md copy had drifted from its source.

@swapnilpaliwal-sd swapnilpaliwal-sd added enhancement New feature or request typescript TypeScript labels Oct 14, 2026
@swapnilpaliwal-sd swapnilpaliwal-sd added python Python skill Agent-facing query skill (skills/axiomcode) labels Oct 14, 2026
@swapnilpaliwal-sd swapnilpaliwal-sd added the plugin the axiomcode plugin: skill + MCP layer label Oct 14, 2026
… on the CLI and as an MCP tool

The index has stored each literal's value, kind and, for a named constant, its name (literals.name) since v8, in
Python and TypeScript among others, but no verb read it: "what is the current value of limit X?" was answered by
querying graph.sqlite by hand. `value <name>` prints the value, its kind and file:line with the line's source.

- exact name first, then every declaration whose last part it is (MAX_ITEMS and Pager.MAX_ITEMS); a name defined
  in several places is listed in all of them with the count, never one picked
- Class.NAME answers for that member; MAX_* / Pager.* list every match (a GLOB prefilter, cheap)
- a name declared without a single literal (a call, a dict or object) prints its declaration line and says so; a
  local says it is a local and where it is assigned; a function or type says it is not a constant; an unknown
  name says so and exits 1
- every language graph of the repository is asked; each row stays in its own graph, nothing is joined
- runs through ax_fresh like the other query verbs: stale rows are marked, and a line that no longer writes the
  graph's value says so; --json is one document

MCP tool value(name) beside context/impact/path/link/tests; help, both SKILL.md copies, AGENTS.md,
rules/axiomcode.mdc and the README list it. tests/surfaces.py, tests/mcp.py and tests/mcp_docs.py know the new
tool; mcp_docs.py's tool list was stale on the base (it still expected three tools and did not read context/link,
5 failures before this). The README's CLI section no longer names --fresh, which failed surfaces.py on the base.
skills/axiomcode/SKILL.md had drifted from its plugin copy (no HTML + CSS line), which failed manifests.py.

Tests: tests/cases/{python,typescript}/value-verb (10 checks each, 0/20 before, 20/20 after), including the
control that a constant initialized through a call is given no value.

Refs #1835
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request 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