aft
aft copied to clipboard
aft_search: unrelated lexical hits for a missing literal, denied path reads as 0 matches, contradictory status
AFT: 0.62.0, OpenCode 2.1.4, macOS.
A few aft_search replies that an agent will misread as real results:
- Unrelated "lexical matches" for a literal that doesn't exist. Query
bash_wait_detach((grep confirms it appears nowhere under the root) returned 14 hits labelled[lexical match], all lines aboutbash_watch. A bare identifier gets an honest "not found … no similar names". A literal with punctuation should also say not found, or the fuzzy fallback should be labelled as fuzzy/similar rather than a match. - A denied out-of-root
path=reads as "0 matches". The reply starts "denied … searching the project index only" and then reports "Found 0 match across 0 file", which reads as "your path has no matches" although that path was never searched. Returning an error, or "path not searched", would be clearer. - Contradictory status lines. One reply said "Search status: fully degraded" while its footer said "trigram: ready, semantic: ready"; a regex-only query said "219 match across 52 file" and then "shown 3 of ≥4 results".
Causes from v0.62.0 source (not re-run):
bash_wait_detach(classifies asCodeLiteral, notIdentifier(search_b2/router.rs:77-117), and the honest not-found path is gated onIdentifierplusnearest_namesaccepting only[A-Za-z0-9_$](semantic_search/mod.rs:~4607,nearest_names.rs:110-134). The lexical lane then tokenizes the query intobash/wait/detach, andmod.rs:~8141-8146labels any group with lexical results[lexical match]without re-checking the literal. Suggested: strip trailing punctuation before the not-found check for code literals, or drop/relabel lexical hits that don't contain the literal ("token match").- The "denied … then Found 0 match" reply is the plugin re-running without
pathafter an external-root denial (opencode-plugin/src/tools/semantic.ts:~198-235), followed by the normal grep summary (commands/grep.rs:457). "0 matches in the project; the denied path was not searched" would fix the reading. - "fully degraded" comes from the response's
fully_degraded(the bounded fallback scan used for this request,subc_format.rs:~2306), while "trigram: ready, semantic: ready" is the project's resident index status (SearchLaneStatus::text,mod.rs:1834). Suggest omitting or relabelling the lane lines ("project index: …") when the response is degraded.
The fixes are included in v0.64.0. Missing literals are distinguished from similar lexical results when absence is established; denied external paths are refused as not searched; request status identifies filesystem fallback; and regex summaries distinguish matching lines from file results. Please reopen with a current reply if you still see the misleading wording or contradictory counts.