Version: dacli 0.4.38 (commit 34beaa2)
Problem
search matches substrings. Looking up a short identifier also matches every identifier that contains it: R-021 matches ADR-021, CR-021 and so on. Title matches score higher than body matches, so a section that merely contains the ID in its title can outrank the one you're looking for. For LLM agents that navigate arc42 docs by risk, ADR or requirement IDs, this leads to reading and editing the wrong section.
Reproduction
= Decisions
== ADR-021 Use a cache
We cache results.
== Risks
=== Stale data
See R-021 in the risk list.
dacli --docs-root docs search "R-021"
Expected
Only the "Stale data" section, or at least that section ranked first.
Actual
path: doc:adr-021-use-a-cache score: 0.968 context: ADR-021 Use a cache
path: doc:risks.stale-data score: 0.607 context: === Stale data See R-021 in the risk list.
(When R-021 is also in a heading, it ranks first, 1.0 vs 0.968, but ADR-021 is still returned.)
Proposal
Add a --word (word-boundary) or --exact option to search and the MCP search tool. With it, R-021 would match only where it isn't preceded or followed by an alphanumeric character or -. A cheaper alternative: rank whole-word matches above substring matches by default.
Version: dacli 0.4.38 (commit 34beaa2)
Problem
searchmatches substrings. Looking up a short identifier also matches every identifier that contains it:R-021matchesADR-021,CR-021and so on. Title matches score higher than body matches, so a section that merely contains the ID in its title can outrank the one you're looking for. For LLM agents that navigate arc42 docs by risk, ADR or requirement IDs, this leads to reading and editing the wrong section.Reproduction
dacli --docs-root docs search "R-021"Expected
Only the "Stale data" section, or at least that section ranked first.
Actual
(When
R-021is also in a heading, it ranks first, 1.0 vs 0.968, butADR-021is still returned.)Proposal
Add a
--word(word-boundary) or--exactoption tosearchand the MCPsearchtool. With it,R-021would match only where it isn't preceded or followed by an alphanumeric character or-. A cheaper alternative: rank whole-word matches above substring matches by default.