Skip to content

Comments

fix(way-match): address 6 code review items from PR #15#23

Merged
aaronsb merged 2 commits intomainfrom
fix/way-match-review-items
Feb 16, 2026
Merged

fix(way-match): address 6 code review items from PR #15#23
aaronsb merged 2 commits intomainfrom
fix/way-match-review-items

Conversation

@aaronsb
Copy link
Owner

@aaronsb aaronsb commented Feb 16, 2026

Summary

Addresses all 6 code review issues filed after PR #15 merge:

Test plan

  • make -f tools/way-match/Makefile local builds clean
  • Fixtures: BM25 26/32 (81%), 0 FP — matches baseline
  • Integration: BM25 27/31 (87%), 0 FP — matches baseline
  • Suggest mode verified working after heap changes

Closes #16, closes #17, closes #18, closes #19, closes #20, closes #21

- Fix body_start pointer arithmetic in suggest mode (#18): use +4 for
  \n--- then optionally skip trailing newline, instead of assuming +5
- Move large stack arrays to heap (#16, #21): SuggestEntry[], vocab_words[],
  unused_words[] in cmd_suggest (~2.1MB) and TokenList in index_document
  (~512KB) now use calloc/free
- Fix JSON parser substring matching (#17): json_get_string and
  json_get_number now verify matched "key" is followed by colon (key
  position), preventing false matches against values
- Document why NCD fallback uses hardcoded 0.58 threshold (#19): BM25 and
  NCD scales don't map cleanly, fixed value tuned against test corpus
- Fix find_best_match to return highest-scoring way (#20): BM25 path now
  scores all ways and returns best match above threshold; NCD keeps
  first-match behavior (binary scorer)
@aaronsb aaronsb merged commit ac847c2 into main Feb 16, 2026
2 checks passed
@aaronsb aaronsb deleted the fix/way-match-review-items branch February 17, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment