Repository navigation
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
Open
swapnilpaliwal-sd wants to merge 1 commit into
swapnilpaliwal-sd wants to merge 1 commit into
Conversation
… 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
Open
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1971
Part of #1835.
What
axiomcode value <name>reads a named constant's current value from the index: value, kind, andfile:linewith the source line. It is on the CLI and is also an MCP tool,value(name), beside context, impact, path, link and tests.The
literalstable 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 queryinggraph.sqliteby hand.Behaviour
Class.NAMEanswers for that member only.MAX_*andPager.*list every match.--jsonprints 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.pyandrepo_arg.pypass.freshness.pypasses 117/118. The one failure fails the same way on the untouched base.mcp_docs.pyhad a stale tool list,surfaces.pyfailed because the README named--fresh, andmanifests.pyfailed because one SKILL.md copy had drifted from its source.