Add privacy-preserving search receipts#406
Conversation
|
Did a focused pass on this first slice against the receipt shape discussed in #382. Local validation from a temp checkout of the PR head:
The focused receipt test passes, and MCP typecheck passes. I do not see a blocker from this pass. The narrow Generated with ax. |
|
Fresh local verification from a Windows checkout of this PR head (
All passed. The install flag is just to make pnpm 11's build-script approval gate non-interactive locally; it does not require or imply a code change. The focused receipt test also verifies the key privacy boundary: the receipt includes hashes/ranks/ranges, while raw query text, raw chunk content, raw relative path, and raw codebase path are absent from the receipt JSON. |
Summary
Refs #382.
This adds an optional
includeReceiptflag to the MCPsearch_codetool. When enabled, the existing search response is preserved and a privacy-preserving JSON receipt is appended with:receipt_id,query_hash,codebase_path_hash, andindex_snapshot_idresult_countThe receipt intentionally avoids raw query text, raw code content, raw local codebase paths, and raw relative file paths.
Why
Issue #382 proposes a retrieval-boundary receipt that lets downstream clients or eval harnesses correlate returned search results with later loaded context chunks without requiring Claude Context to own full agent telemetry.
Validation
Current local validation on Windows, 2026-07-02:
pnpm install --frozen-lockfile --config.dangerouslyAllowAllBuilds=truepnpm --filter @zilliz/claude-context-core buildpnpm --filter @zilliz/claude-context-mcp exec node --import tsx --test src/handlers.search-receipt.test.tspnpm --filter @zilliz/claude-context-mcp testpnpm --filter @zilliz/claude-context-mcp typecheckAll of the above pass. The install flag is only to make pnpm 11's build-script approval gate non-interactive in local verification; it does not change the package code.