Repository navigation
feat(search): add bounded archive discovery with eligible replies - #803
Merged
Merged
Conversation
leemour
force-pushed
the
feat/combined-search
branch
from
October 9, 2026 12:31
9259bfb to
99344d8
Compare
leemour
force-pushed
the
feat/combined-search
branch
from
October 10, 2026 13:44
ac68a77 to
2452271
Compare
leemour
marked this pull request as ready for review
October 10, 2026 13:45
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.
Natural questions require words that the existing strict matcher cannot find together, and short replies often lack the query's words entirely. Add explicit archive discovery through CLI
search messages --discover, MCPdiscover=trueand SDKSearchQuery.discover. Partial lexical retrieval uses existing SQLite FTS/BM25, ranks bounded evidence with stemmed term coverage and reciprocal retrieval rank, and recovers eligible direct replies. A reply inherits its parent's lexical rank and comes first on an equal score. No neural assets, full-archive snapshot or automatic conversation rebuild is used.Hard account/chat/sender/date/only constraints apply to both parent and reply. Explicit Boolean syntax, phrases, wildcards, AST, exact and newest requests retain strict behavior. Matched/missing terms, reply-parent provenance, candidate depth and truncation make partial evidence visible. Discovery searches the archive, refuses legacy/regex/server-only modes, and preserves requested surrounding/thread context. Saved runs keep the additive option. Plain keyword discovery also preserves used prefix/correction provenance.
Migration 29 adds a derived live-reply index, reserved by merged PR #817; no message data changes. Rewrite
onlyselection into indexed message-key lookups, avoiding a correlated JSON test over every archive row. Retrieve at most 300 lexical candidates and 100 proposed replies, then keep at most 300 scoring candidates under existing body/time budgets. A full-shortlist regression test ensures replies can enter the final pool.The original one-default proposal remains unqualified by its approved quality gates. This is an additive opt-in; strict CLI/MCP defaults and no-language SDK compatibility remain unchanged. The source handoff and query guide describe this boundary. Synthetic research, original artifacts, the ranking matrix and fresh/scaling reports live in WireCatLabs/cli-testing PR #5. The freshly authored fixture is not an independent human/real-world evaluation; rank one and paraphrases remain limitations. Scores are not answer confidence.
Validation: lint, typecheck, 2790 passing tests (2 existing skips), coverage floors, documentation checks and Bun smoke pass. Isolated SDK tests cover scope/account/deletion, full candidate pools, syntax/AST/flags, contexts, typo provenance, cancellation and bounds. Telegram and MAX offline adoption tests are being verified against a packed build before the shared release and exact consumer pin bumps. No real account/store/messenger operation was performed.