You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(graph): use Kuzu 0.11 native features (FTS, param LIMIT, []string)
Kuzu 0.11.3 bundles features that were unavailable or broken in 0.7.1.
This commit unwinds the workarounds documented in CLAUDE.md.
### FTS (fulltext search)
`CreateIndexes()` was a no-op because Kuzu 0.7.1's FTS extension needed
a network INSTALL (incompatible with air-gapped builds). 0.11.3 ships
FTS pre-bundled. `CreateIndexes()` now:
- `INSTALL fts; LOAD EXTENSION fts;`
- `CALL DROP_FTS_INDEX` / `CALL CREATE_FTS_INDEX` for two indexes:
- `code_node_label_fts` over `(label, fqn_lower)`
- `code_node_lexical_fts` over `(prop_lex_comment, prop_lex_config_keys)`
`SearchByLabel` / `SearchLexical` route through `CALL QUERY_FTS_INDEX`
with BM25 score ranking. A trailing `*` is auto-appended when the user
query is a single bare token, giving prefix-match UX similar to the old
CONTAINS behaviour. CONTAINS-based fallbacks remain in place for graphs
that never ran enrich (FTS index would be missing).
The mutation gate (`MutationKeyword`) allows the read-only
`CALL QUERY_FTS_INDEX` procedure; the catalog writers
`CALL CREATE_FTS_INDEX` / `CALL DROP_FTS_INDEX` stay blocked under
`OpenReadOnly`.
### Parameterized LIMIT / SKIP
Kuzu 0.7.1 rejected `$lim` / `$skip` bindings — values had to be inline
literals. 0.11.3 accepts them as bound parameters. Affected sites:
- `internal/graph/indexes.go` — SearchByLabel / SearchLexical
- `internal/graph/reads.go` — FindByKindPaginated
- `internal/query/service.go` — FindCycles, FindDeadCode
- `internal/mcp/tools_graph.go` — list-edges, ego-neighbours, endpoints-by-id
Helper `intLiteral` is removed (was only used to format inline LIMITs).
### Drop `stringsToAny` widener
Kuzu 0.7's Go binding required `[]any` for list parameters; `[]string`
tripped `unsupported type` in `goValueToKuzuValue`. 0.11.3's binding
accepts `[]string` directly. The widener helper is removed and its
two callers (`query.FindDeadCode`, `topology.FindServicesContainingNodes`)
pass `[]string` straight.
### CLAUDE.md
Reworked the Kuzu quirks section into "lifted in 0.11.3" vs "still
present" buckets so future contributors don't reintroduce workarounds
that the runtime no longer needs.
### Verification
- `cd go && CGO_ENABLED=1 go test ./... -count=1` — 883 passed
- End-to-end on `~/projects/polyglot-bench/airflow`:
enrich exit 0, 95k nodes, 246k edges, FTS search returns BM25-ranked hits
- End-to-end on `~/projects/`:
enrich exit 0, 187k nodes, 414k edges, 1m 29s wall, 1.88 GiB peak RSS
FTS `'service*'` returns top-5 ranked at scores ~12-14
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments