Skip to content

fix(#558): codedb_query filter op no longer silently no-ops; output reflects pipeline transforms#559

Merged
justrach merged 2 commits into
release/0.2.5825from
fix/issue-558-query-filter
Jun 10, 2026
Merged

fix(#558): codedb_query filter op no longer silently no-ops; output reflects pipeline transforms#559
justrach merged 2 commits into
release/0.2.5825from
fix/issue-558-query-filter

Conversation

@justrach

Copy link
Copy Markdown
Owner

Fixes #558.

Problem

  1. filter only read ext/glob; any other param (e.g. the natural pattern) silently passed all files through — live repro showed find → filter → limit 3 rendering all 50 files with stage trace 1: filter (50 files).
  2. find printed its list eagerly, so downstream filter/limit never affected the rendered output (the final-set print is gated on empty output).

Fix

  • filter: glob orelse pattern, bare-pattern **/ auto-promotion (same rule as codedb_search path_glob), and an explicit error: filter needs 'glob' (alias 'pattern') or 'ext' via finishQueryWithFailure when neither is present
  • find: defers its listing unless it is the last step — the pipeline tail prints the final transformed set
  • partial-results contract (Agent Context Planner: make codedb_query the reliable context assembly path #356) preserved: finishQueryWithFailure now prints the file set accumulated before the failing step (and the unknown op branch joins the contract)
  • codedb_query inputSchema documents the filter params

Failing Test

test "issue-558: codedb_query filter must filter (or error) — never silently pass every file" (src/test_query.zig), committed red in f7b717f: pre-fix 65/66 (auth.ts leaked into output).

Validation

zig build test: all green (729 tests), including issue-356-1/356-3 partial-results and stage-tail tests.

🤖 Generated with Claude Code

justrach and others added 2 commits June 10, 2026 10:36
…through

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…arams; pipeline output reflects transforms

filter now reads glob orelse pattern, auto-promotes bare patterns to
'**/<pattern>' (same rule as codedb_search path_glob), and errors via
finishQueryWithFailure when no recognized param is present instead of
silently passing every file through.

find defers its listing unless it is the pipeline's last step, so the
rendered output is the post-filter/limit set (previously the eager
50-file dump made downstream transforms invisible). To preserve the
issue-356 partial-results contract, finishQueryWithFailure now prints
the file set accumulated before the failing step, and the unknown-op
branch joins that contract.

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 104244 104599 +0.34% +355 OK
codedb_changes 11043 11495 +4.09% +452 OK
codedb_context 1208325 1163910 -3.68% -44415 OK
codedb_deps 347 317 -8.65% -30 OK
codedb_edit 51208 48431 -5.42% -2777 OK
codedb_find 11932 9570 -19.80% -2362 OK
codedb_hot 24774 24811 +0.15% +37 OK
codedb_outline 35328 34877 -1.28% -451 OK
codedb_read 16637 18894 +13.57% +2257 NOISE
codedb_search 26534 26257 -1.04% -277 OK
codedb_snapshot 63756 70023 +9.83% +6267 OK
codedb_status 9436 8906 -5.62% -530 OK
codedb_symbol 50537 49588 -1.88% -949 OK
codedb_tree 47711 50033 +4.87% +2322 OK
codedb_word 12358 12109 -2.01% -249 OK

@justrach justrach merged commit 75e2922 into release/0.2.5825 Jun 10, 2026
2 checks passed
@justrach justrach deleted the fix/issue-558-query-filter branch June 10, 2026 03:20
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