Make prompt history the default search scope#39
Merged
Merged
Conversation
why: Prompt-history stores should participate in the default prompt search, while full conversation transcripts remain an explicit opt-in surface. Naming that boundary as scope gives CLI, query, and MCP callers a single user-facing selector. what: - Treat dedicated prompt-history records as prompts and classify conversation scope by store role. - Replace search and grep --type with --scope for prompt, conversation, and all searches. - Rename MCP search inputs and capability metadata to expose scope, with tests covering the new defaults.
why: The search breadth selector is now scope in the public CLI and MCP surfaces. Keeping internal dataclass fields, type aliases, and test fixtures named search_type would preserve the ambiguity that the new vocabulary removes. what: - Rename SearchType/SearchTypeName aliases to SearchScope/SearchScopeName. - Rename SearchQuery, SearchArgs, and GrepArgs fields from search_type to scope. - Update engine, CLI, TUI, MCP, and tests to use scope throughout the internal API.
why: The new scope vocabulary changes how users choose default prompt search versus explicit conversation search. The docs and MCP-facing guidance need to teach that boundary consistently and stop pointing at removed search_type/search_history surfaces. what: - Update README, CLI, MCP, library, query-language, backend, and changelog docs for --scope and scope: usage. - Refresh docs-only FastMCP signatures and library snippets to use scope. - Adjust user-facing MCP/TUI/source descriptions from prompt-history wording to prompt/conversation scope wording.
why: Prompt-scope search should prefer dedicated prompt-history stores when they are present. Filtering only by record kind allowed user turns from Claude project transcripts to leak into default grep/search results and made broad default searches slower than promised. what: - Track agents with discovered prompt-history sources and skip their chat transcript sources during prompt-scope planning. - Keep record-level scope matching local to record kind so transcript-only source sets still work. - Add regression coverage for Claude history versus project transcripts and source planning.
why: Grep output is line-oriented. Letting bare patterns match source metadata such as paths could emit heading-only records when the record text had no matching line, which made default terminal output look like empty responses. what: - Add an internal search match-surface selector to SearchQuery. - Make grep use the text-only surface while regular search keeps the metadata-rich haystack. - Preserve the selected surface when rebuilding parsed query-language searches. - Add regression coverage for terms that appear only in a source path.
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.
Summary
scope/--scopeselection for prompts, conversations, and all records across CLI, query language, MCP, and library APIs.Closes #38.
Test Plan
rm -rf docs/_build; uv run ruff check . --fix --show-fixes; uv run ruff format .; uv run ty check; uv run py.test --reruns 0 -vvv; just build-docs;