Skip to content

fix(#570): codedb_context falls back to plain words for all-lowercase tasks#571

Merged
justrach merged 2 commits into
release/0.2.5825from
fix/issue-570-context-fallback
Jun 10, 2026
Merged

fix(#570): codedb_context falls back to plain words for all-lowercase tasks#571
justrach merged 2 commits into
release/0.2.5825from
fix/issue-570-context-fallback

Conversation

@justrach

Copy link
Copy Markdown
Owner

Fixes #570.

Problem

extractContextCandidates only 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

  • Suite green (full zig build test)
  • Live: codedb context "fix search ranking" now returns a composed block keyed on ranking/search instead of the error

🤖 Generated with Claude Code

justrach and others added 2 commits June 10, 2026 12:27
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>
@github-actions

Copy link
Copy Markdown

Benchmark Regression Report

Thresholds: 10.00% and 50,000 ns absolute delta

NOISE means the percentage threshold was exceeded, but the absolute delta was too small to fail CI.

Tool Base (ns) Head (ns) Delta Abs Delta (ns) Status
codedb_bundle 71131 70693 -0.62% -438 OK
codedb_changes 7597 7072 -6.91% -525 OK
codedb_context 1135783 1095229 -3.57% -40554 OK
codedb_deps 294 281 -4.42% -13 OK
codedb_edit 39437 37796 -4.16% -1641 OK
codedb_find 6280 5525 -12.02% -755 OK
codedb_hot 14311 14546 +1.64% +235 OK
codedb_outline 27152 29870 +10.01% +2718 NOISE
codedb_read 13056 12360 -5.33% -696 OK
codedb_search 26877 25978 -3.34% -899 OK
codedb_snapshot 108893 67110 -38.37% -41783 OK
codedb_status 5487 5151 -6.12% -336 OK
codedb_symbol 35789 36933 +3.20% +1144 OK
codedb_tree 15242 16426 +7.77% +1184 OK
codedb_word 7455 7342 -1.52% -113 OK

@justrach justrach merged commit 43228cc into release/0.2.5825 Jun 10, 2026
2 checks passed
@justrach justrach deleted the fix/issue-570-context-fallback branch June 10, 2026 04:32
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.

1 participant