Repository navigation
index: literals carry numbers and booleans, and a constant answers with its value - #1857
Merged
Merged
Conversation
…th its value
A spec's factual claims are disproportionately numbers -- a retry count, a page
size, a timeout, a default -- and the graph could locate every one of them and
supply none: the index kept literalType=STRING rows only, and even a string
literal was stored as (value, file, line) with no link to the constant it
initializes. The parsers were never the gap -- all five emit numeric and
boolean literals, and TS/JS emit object keys and values (OBJECT_PROPERTY_KEY /
PROPERTY_VALUE roles) -- the rows were dropped at indexing.
- literals gains kind ('string' | 'number' | 'bool', normalized across the five
per-language enums) and name: the constant a scalar initializes, linked when
strictly one literal sits on the declaration line of strictly one
const/variable/field/enum_member symbol, with no call on the line, the literal
in the language's VALUE position (litLinkRoles -- a subscript's key and a
call's argument never link), and no sign-hiding parent (JavaScript's UNARY
around -5). Dict passes, not correlated subqueries: the UPDATE form ran 67s
against 4.8s on a mid-sized project because the literals indexes do not exist
yet at that point; the dict form indexes the same project in 3.8s.
- impact: a const target's first line states its value -- `change: const
MAX_ITEMS = 5` -- so a limit is read off the answer, not the file.
- the consumers that join literals as KEYS (ax_registration, graph_sql's
literal fact, context's route sweep) filter kind='string', so a numeric "1"
never joins a retry count to a topic; each tolerates a pre-v8 index.
- INDEX_VERSION 7 -> 8; freshness re-indexes existing graphs.
Verified: new constant-value cases (python + typescript, 8/8, with a
call-initializer control); suites python 298/298, java 333/333, csharp 208/208;
TS/JS at exact parity with the integration baseline's pre-existing failures
(one refresh-banner race reproduced on both sides, passes isolated). On a
mid-sized corpus project: 22,155 -> 27,806 literal rows, 793 named, a 10/10
random sample audit against source, and one subscript-key mislink
(d["timeout_no_item"] as a field's value) caught and excluded by the role
whitelist.
Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
swapnilpaliwal-sd
requested review from
JaredHLZhang,
Whua689 and
suyashpaliwal26
as code owners
October 6, 2026 21:21
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 the external report's finding 2 ("a spec's numbers are the one thing the graph cannot supply") and answers its open question 3 — there is now a supported way to ask "what is the value of this constant":
impact MAX_ITEMSopens withchange: const MAX_ITEMS = 5 [field].Where the gap actually was. Not the parsers: all five languages already emit numeric and boolean literals, and TS/JS emit object-literal keys and values under their own edge roles. The query frontend dropped every non-STRING row and never joined a literal to the symbol it initializes. No parser change; the parser version stays at its already-bumped 0.1.3.
What changed
literals(value, file, line)→+ kind ('string'|'number'|'bool'), + name— the constant a scalar initializes, linked only when one literal sits on one declaring symbol's line with no call, in the language's value position (litLinkRoles; a subscript key liked["timeout"]or a call argument never links), and no sign-hiding parent on the line (JSUNARYaround-5).impactprints the value on const/field targets; SKILL.md names the question shape.literalfact, context's route sweep) filterkind='string'— a numeric"1"must not join every retry count — and each tolerates a pre-v8 index.Evidence
constant-valuecases (python + typescript, 8/8) including a call-initializer control (RETRY_LIMIT = pick(3)names no value).