Commit 607fbfd
fix(error-lookup): simplify isUsefulSemanticChunk — shape-only check
Codex review feedback. Two related issues:
1. Sourceish set used `match.source` and `match.title` to detect a
rendered file-path heading line. But `/api/search` rewrites
`source` to a public URL (`_aztec_source_url` produces e.g.
`https://github.com/.../foo.nr`), so the bare-path heading
`aztec-nr/.../foo.nr` never matched the URL — the heading was
never stripped, the chunk fell through to the path-shape check
which also missed because `# foo/bar.nr` contains whitespace
from the markdown marker. Result: a class of empty chunks
slipping through both gates.
2. The mitigation — strip a leading `#+ ` from each line before
the path-shape predicate — makes the metadata coupling
unnecessary. Drop the sourceish comparison entirely. New
helper `lineIsPathShaped` strips heading markers, then checks
"contains `/` and no whitespace". Real signature lines always
have whitespace (`pub fn ...`, `struct ...`, `pub use a::b;`),
so they never trip the predicate.
Equivalent fix on the docsgpt side: AztecProtocol/honk-ai#66
gets the same shape-only simplification.
New regression test: chunk with `#`-prefixed heading body and a
URL-rewritten source field — the exact failure mode codex
described — is correctly identified as "no useful results".
283/283 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9d41359 commit 607fbfd
2 files changed
Lines changed: 48 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
34 | 48 | | |
35 | 49 | | |
36 | 50 | | |
| |||
43 | 57 | | |
44 | 58 | | |
45 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
46 | 68 | | |
47 | 69 | | |
48 | 70 | | |
| |||
54 | 76 | | |
55 | 77 | | |
56 | 78 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
304 | 304 | | |
305 | 305 | | |
306 | 306 | | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
307 | 331 | | |
308 | 332 | | |
309 | 333 | | |
| |||
0 commit comments