Skip to content

index: literals carry numbers and booleans, and a constant answers with its value - #1857

Merged
swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
fix/constants-queryable
Oct 7, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
fix/constants-queryable

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

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_ITEMS opens with change: 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 like d["timeout"] or a call argument never links), and no sign-hiding parent on the line (JS UNARY around -5).
  • impact prints the value on const/field targets; SKILL.md names the question shape.
  • Key-joining consumers (ax_registration, graph_sql's literal fact, context's route sweep) filter kind='string' — a numeric "1" must not join every retry count — and each tolerates a pre-v8 index.
  • INDEX_VERSION 7 → 8.

Evidence

  • New constant-value cases (python + typescript, 8/8) including a call-initializer control (RETRY_LIMIT = pick(3) names no value).
  • Suites: python 298/298, java 333/333, csharp 208/208; TS/JS at exact parity with the integration baseline's pre-existing failures (diffed FAIL-by-FAIL against a clean checkout; the one extra was a graph-refresh banner race that passes isolated, twice).
  • Mid-sized corpus project: 22,155 → 27,806 literal rows, 793 named, 10/10 random-sample audit against source; index time 4.8s (old) → 3.8s (new) after replacing a correlated-subquery UPDATE that ran 67s.

…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
swapnilpaliwal-sd merged commit 3a10e11 into apps/integration-0.1.9 Oct 7, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the fix/constants-queryable branch October 7, 2026 03:17
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