Skip to content

fix(context): search follow-ups to #146 (snake_case, Windows fixtures) - #168

Merged
moshest merged 2 commits into
mainfrom
claude/project-thread-2fl1cl
Sep 27, 2026
Merged

moshest merged 2 commits into
mainfrom
claude/project-thread-2fl1cl

Conversation

@moshest

@moshest moshest commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

Before: since #146, searching for a snake_case identifier such as spring_boot matched "spring" and "boot" as separate words. A page that mentions both words apart could outrank the page that contains the identifier, and in one probe the right page fell below the relevance cutoff entirely. Separately, Test (Windows) on main went red because one of #146's retrieval tests fails when fixtures are checked out with CRLF line endings.

After: underscores stay inside a word, so spring_boot matches the identifier again, as it did before #146. The crash fixes from #146 are unchanged, and a topic made only of underscores still returns nothing without an error. The retrieval fixtures check out with LF on every platform, so the Windows test job passes again.

How:

  • buildQuery keeps _ in the set of characters that stay inside a word. The part is still quoted, so FTS5 turns it back into an adjacent phrase and it can't become an operator. The README and the function comment now describe the underscore exception. One new test fails without the fix.
  • .gitattributes sets eol=lf for packages/context/src/fixtures/**. The failing test matches /```gdscript\n[\s\S]*?\n```/ against fixture content read from disk. I reproduced the failure on Linux by converting the fixture to CRLF. A core.autocrlf=true clone now keeps the fixtures LF while other files still convert. fix(context): handle literal search topics safely (#145) #146's CI ran before the Windows job existed, which is why this didn't show up earlier.

Includes a patch changeset for @neuledge/context, so the search fix ships in the same release as #146.

Validated locally: lint, build and test pass (context 259, registry 103).

🤖 Generated with Claude Code

https://claude.ai/code/session_01UX3uvgjRrv9uYuZxKjNF4o

#146 made search topics literal, but it also dropped "_" from the characters
kept inside a word. A query for `spring_boot` became two ANDed terms, so a
document mentioning "spring" and "boot" apart could outrank the one containing
the identifier, or push it below the relevance cutoff entirely.

"_" now stays inside a word. `spring_boot` is quoted as one part, and FTS5
tokenizes it back into an adjacent phrase, which is how main behaved before
#146. Topics made only of underscores still return nothing without erroring.

The new test fails without the fix.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UX3uvgjRrv9uYuZxKjNF4o
@changeset-bot

changeset-bot Bot commented Sep 27, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1e249df

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@neuledge/context Patch
@neuledge/registry Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

The retrieval fixtures added in #146 are read from disk and matched with
/```gdscript\n[\s\S]*?\n```/. Windows runners check files out with CRLF, so
the match returned undefined and "preserves examples when matching content
exceeds the token budget" failed on Test (Windows). #146's CI ran before the
Windows job existed, so this only showed up once it merged.

Reproduced on Linux by converting gdscript-signals.md to CRLF. A clone with
core.autocrlf=true now keeps the fixtures LF while other files still convert.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UX3uvgjRrv9uYuZxKjNF4o
@moshest moshest changed the title fix(context): keep snake_case identifiers together in search fix(context): search follow-ups to #146 (snake_case, Windows fixtures) Sep 27, 2026
@moshest
moshest marked this pull request as ready for review September 27, 2026 08:02
@moshest
moshest merged commit 6a0681c into main Sep 27, 2026
4 checks passed
@moshest
moshest deleted the claude/project-thread-2fl1cl branch September 27, 2026 08:03
@github-actions github-actions Bot mentioned this pull request Sep 27, 2026
moshest pushed a commit that referenced this pull request Sep 27, 2026
Releases @neuledge/context 1.2.7 -> 1.2.8 (patch).

Consumes two patch changesets on @neuledge/context:
- tidy-ravens-search.md (#146): search topics are literal keywords, so
  malformed quotes and FTS operator words no longer cause SQLite errors.
- keep-snake-case.md (#168): underscores stay inside search words, so
  snake_case identifiers match as one phrase.

@neuledge/registry 0.0.20 -> 0.0.21 is the automatic dependent bump for the
private workspace package.

Verified before merging: npm dist-tags.latest is 1.2.7 and 1.2.8 is not
published yet.
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