Skip to content

feat(search): --content ranks conversation text; --raw keeps grep parity - #33

Merged
lroolle merged 1 commit into
mainfrom
feat/search-content-signal
Aug 4, 2026
Merged

feat(search): --content ranks conversation text; --raw keeps grep parity#33
lroolle merged 1 commit into
mainfrom
feat/search-content-signal

Conversation

@lroolle

@lroolle lroolle commented Aug 4, 2026

Copy link
Copy Markdown
Member

What

--content was grep parity over raw transcript lines, so injected noise dominated ranking: a Stop-hook line fired every turn put a 327-hit boilerplate session first while the session that actually designed the topic ranked #3.

  • Default --content parses candidate sessions (all providers, sidechains included) and counts only conversation text — user prompts and assistant text/thinking. Hook attachments, tool results, command echoes, meta lines count zero.
  • New --raw keeps the old grep-parity line scan verbatim.
  • Role-labeled previews ([user]/[assistant]/[agent]) in table and --json (previews, max 3); path added to session/content JSON results.
  • Cheap raw-line prefilter gates the parse; skipped when JSON escaping could hide the query bytes (correctness over speed).
  • make build refreshes a stale root ./ccx so it can't shadow fresh builds.

Evidence

Devlog: docs/devlog/2026-08-03-content-search-noise.org (findings + resolution). Live acceptance: ccx search --content deadman ranks the naming-verdict session #1 (27 conversation hits, preview shows it); the 330-raw-hit boilerplate session is absent from default, still #1 under --raw. Timing at par: 20s signal vs 23s raw.

Tests

go test ./... green; new: TestScanConversationText*, TestMatchSnippet, TestRawPrefilterSafe.

🤖 Generated with Claude Code

Default --content now parses candidate sessions and counts only
conversation text (user prompts, assistant text+thinking), so ranking
follows discussion instead of injected boilerplate. Role-labeled
previews in table and --json; path added to session/content JSON
results. --raw keeps the old grep-parity raw line scan. A cheap raw
prefilter gates the parse, skipped when JSON escaping could hide the
query. Makefile build refreshes a stale root ./ccx.

See docs/devlog/2026-08-03-content-search-noise.org.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@lroolle
lroolle merged commit 7620aa3 into main Aug 4, 2026
2 checks passed
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