fix(#570): codedb_context falls back to plain words for all-lowercase tasks#571
Merged
Merged
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… tasks extractContextCandidates only accepts identifier-shaped tokens, so a natural-language task like 'fix search ranking' — the documented input shape — dead-ended with 'no candidate identifiers found'. When the identifier pass finds nothing, extractContextFallbackWords now harvests the task's plain words (>=4 chars, glue/generic words dropped, longest first since longer is more specific) capped at CONTEXT_MAX_CANDIDATES. The error remains only when even the fallback is empty. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Benchmark Regression ReportThresholds: 10.00% and 50,000 ns absolute delta
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #570.
Problem
extractContextCandidatesonly accepts identifier-shaped tokens (snake_case / acronyms / camelCase / quoted). Natural-language tasks — the documented input shape — produced zero candidates and the handler dead-ended:codedb context "fix search ranking"→no candidate identifiers found. Hit by every all-lowercase task in both audit rounds.Fix
extractContextFallbackWords: when the identifier pass finds nothing, harvest plain words ≥4 chars, drop glue/generic words, sort longest-first ('ranking' beats 'fix'), cap at CONTEXT_MAX_CANDIDATES. Error only when even the fallback is empty.Failing Test
test "issue-570: …"(src/test_mcp.zig), committed red: 106/107 pre-fix.Validation
zig build test)codedb context "fix search ranking"now returns a composed block keyed on ranking/search instead of the error🤖 Generated with Claude Code