search_text: snippets truncate inside the match, there is no exclude_tests, and path-only hits read as content hits #524
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#524
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
search_textis meant to replacerg -n, but its default output usually cannot be read without a second call. Three problems, all seen during the 2026-11-09 review:context_tokens: 32counts trigram tokens, so the result looks like… p\n (\<<attach_or_spawn_daemon>>`); th …. The highlighted match is truncated too: the querybuiltincame back as<>and<>, andLanguagePluginas<>/<>. Rows reportsnippet_origin: unlocated. An agent then needsline_text=trueorread_code` for every hit.exclude_tests. A sweep for production.unwrap()orCOMMITreturns mostly test hits, which the agent has to filter by hand throughenclosing_symbol.find_referencesalready hasexclude_tests.docs/operationsreturned the file withmatches_in_file_unmeasured: literal_absent_from_body. A query with an embedded"returnstotal: 0; theseparator_scandisclosure covers it, but the zero is still a trap.Proposal
line_text), and a highlight is never truncated inside the match.exclude_testswith the same test classifierfind_referencesuses.match_in: "path"and keep them out oftotal, or count them separately.Acceptance
search_text "attach_or_spawn_daemon"rows show the full source line.exclude_tests=true,.unwrap()rows contain no#[cfg(test)]/tests/hits.Found by three of the automated reviewers independently (2026-11-09).
Filed from a five-agent review of master @
e3ec6ead(bloat, robustness, agent usefulness, docs, architecture). Every finding was spot-checked in the main session before filing.Reproduced in every language on 2026-11-09:
Sinatra::<<Bas>>;context_tokens:4returns' … etting … '.test_<<url_for>>_with_anchorunderwhole_word; on primary,<<supert>>forSUPERTYPE.<<handle_facto>>.unlocatedand cut mid-argument.tests/<<gitignor>>.$(core.$constructor() return'… .$construc …'with no highlight andsnippet_origin: unlocated.other_linereported correctly).buildagent referenced this issue2026-11-09 09:21:00 +01:00
Consolidated into #521 during the 2026-11-09 triage. The remaining scope of this issue is tracked there as a checklist item; this report stays as the detailed evidence.