Skip to content

[codex] fix node label lookup normalization#1353

Merged
safishamsi merged 1 commit into
Graphify-Labs:v8from
balloon72:codex/node-label-lookup
Jun 17, 2026
Merged

[codex] fix node label lookup normalization#1353
safishamsi merged 1 commit into
Graphify-Labs:v8from
balloon72:codex/node-label-lookup

Conversation

@balloon72

Copy link
Copy Markdown
Contributor

Summary

Fixes node lookup for labels with Unicode normalization differences and full labels that include punctuation.

Root cause

Two lookup paths normalized queries and labels differently:

  • serve._find_node() tokenized the query but compared it mostly against labels that still kept punctuation, so full labels such as Skill /auditar — Auditoría inquisitiva de enlaces could miss.
  • affected.resolve_seed() used plain .lower() comparisons, so an NFD query copied from macOS could fail to match an NFC graph label.

Changes

  • Compare _find_node() queries against tokenized labels while preserving exact, prefix, and substring ordering.
  • Normalize and strip combining marks in affected.resolve_seed() label/source matching.
  • Add regressions for punctuated full-label lookup and NFD-vs-NFC affected seed resolution.

Validation

  • python -m pytest tests/test_serve.py tests/test_affected_cli.py -q
  • python -m graphify update .

Note: local ruff validation was not available in this Windows environment (ruff module missing and uv not in PATH). CI for this repo runs pytest via uv.

@balloon72 balloon72 force-pushed the codex/node-label-lookup branch from 15572a6 to fe23d7d Compare June 17, 2026 06:24
@balloon72 balloon72 marked this pull request as ready for review June 17, 2026 06:26
@safishamsi safishamsi merged commit d885833 into Graphify-Labs:v8 Jun 17, 2026
4 checks passed
galshubeli added a commit to galshubeli/graphify that referenced this pull request Jun 17, 2026
Resolve 39 conflicts, reconciling the FalkorDB migration (cache-free GraphStore,
no networkx) with v8's improvements:

- pyproject: keep falkordb + numpy (v8's _minhash replaced datasketch); drop
  networkx + datasketch.
- build.py: keep v8's dedupe_nodes/dedupe_edges helpers + Graphify-Labs#1257 ghost-collision
  tracking + Graphify-Labs#1327 AST-origin skip, adapted to node_attrs (no in-memory G during
  build); keep the GraphStore build_from_json.
- serve.py: adopt v8 label_tokens matching (Graphify-Labs#1353) + community_name (Graphify-Labs#1305) on
  the cache-free _find_node/_tool_get_node paths.
- analyze.py: keep the simpleCycles UDF path (max_cycle_length bounds it like
  v8's length_bound Graphify-Labs#1196).
- export.py: keep store-native to_json; fold in v8 community_name (Graphify-Labs#1305).
- global_graph.py: keep the GraphStore batch path; adopt v8 remap-and-rewire of
  deduplicated externals.
- affected.py: keep FalkorDB connect_graph + find_node_ids; adopt v8 normalized
  + bare-name matching (Graphify-Labs#1353) in the in-memory fallback.
- __main__.py: keep _connect_graph loading; preserve v8's Graphify-Labs#1019 huge-graph html
  guard by node count; adopt community_name in explain.
- skill docs regenerated from the merged update fragment (prune = deleted +
  changed, Graphify-Labs#1178); update goldens blessed.
- ci.yml: FalkorDB service container.
- tests resolved to the migration versions (seed_graph/store/nxcompat); v8's
  graph.json-loading tests no longer apply.

Verified: package imports, zero runtime networkx, 279/280 merge-relevant tests
pass (1 env tree-sitter fail). Remaining full-suite failures are pre-existing
env (missing tree-sitter parsers) — test_watch prune-edge-case fails at the
pre-merge commit too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
galshubeli added a commit to galshubeli/graphify that referenced this pull request Jun 17, 2026
The v8 merge folded label_tokens matching (Graphify-Labs#1353) into _find_node, but the
cache-free rows are (id, norm_label) tuples with no `d` in scope — a NameError
on every _find_node call (explain / get_node / score). Carry the raw label in
rows (3-tuple) and tokenize that, mirroring _score_nodes. This fix existed in
the working tree but was not staged into the merge commit.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

2 participants