Skip to content

fix(query): credit a search hit to the speaker who said the word - #365

Merged
GeiserX merged 1 commit into
mainfrom
fix/search-cites-matching-speaker
Oct 9, 2026
Merged

GeiserX merged 1 commit into
mainfrom
fix/search-cites-matching-speaker

Conversation

@GeiserX

@GeiserX GeiserX commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

akou search could credit the wrong person. A hit is a BM25 chunk of up to about 60 words, and it can span several speakers. The citation always named the chunk's first line, so a word that Speaker 2 said came back as [17:30 Hands On], the user who opened the chunk. The citation form [HH:MM Name] is meant to say who said it.

The citation now names the first line in the chunk that contains a query term, using the same expanded terms the search scored on. It falls back to the first line when no line matches. The chunk and its lines are unchanged, so the context pack is not affected.

Test, red on main and green here, in tests/query.test.ts:

  • a search hit cites the speaker who said the matched word, not the chunk's first line

The test builds a chunk where Ann speaks first and Ben says "vendor". It checks that the chunk does open on another line, then that the citation names Ben. On main it named Ann.

Bead: akou-z5s

Summary by CodeRabbit

  • Bug Fixes
    • Search citations now identify the first line containing a term from the expanded query, rather than defaulting to the first line in the result. If no matching line is found, citations still use the first line.

A search hit cited the first line of its chunk, so when that line belonged to
another speaker, the citation credited the wrong person for the word that matched.
The citation now names the first line of the chunk that holds a query term,
and falls back to the first line when none does.

Bead akou-z5s.
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: GeiserX/akou/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19e0365f-9f90-4275-aa3a-0f96b0113a34

📥 Commits

Reviewing files that changed from the base of the PR and between dcdf2a3 and 367cbea.


📒 Files selected for processing (2)
  • src/main/query/context.ts
  • tests/query.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.



📝 Walkthrough

Walkthrough

CallQuery.search now cites the first hit line containing an expanded query term. If no hit line contains a term, it cites the first line. A regression test checks that a match on “vendor” cites the speaker of the matching line.

Changes

Search citations

Layer / File(s) Summary
Select the citation line
src/main/query/context.ts, tests/query.test.ts
Search selects the first hit line containing an expanded query term, or the first hit line if none matches. The regression test checks that a match on “vendor” cites Ben’s line.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to 367cb

Search citations now attribute a hit to a line containing the query term when possible, and the regression test checks the speaker attribution. No actionable merge risk is evident.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: search citations now credit the speaker who said the matched word.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.


✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR


  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GeiserX
GeiserX merged commit e6163a8 into main Oct 9, 2026
29 checks passed
@GeiserX
GeiserX deleted the fix/search-cites-matching-speaker branch October 9, 2026 17:26
GeiserX added a commit that referenced this pull request Oct 9, 2026
…aker and akou start and akou quit finish (#374)

## Problem

On 0.6.4, with the Nemotron diarizer on, every call line waited about 2 s for its speaker before it reached the transcript. The first `akou start` after an install gave up at 3 s while the app was still coming up. `akou quit` on Linux could hang after a call. All three are fixed on main and no release carries them yet.

## What 0.6.5 ships

- A call line is written when its segment closes, and its speaker follows as a correction to the same line (#359).
- `akou start` waits up to 20 s for a slow first launch and stops the idle launcher afterwards (#360).
- `akou quit` always finishes on Linux (#367).
- A search hit names the speaker who said the matched word (#365).
- A file job without speaker labels fetches, and is admitted for, only the models it runs (#364).
- Three messages no longer point at a command that cannot help (#366).
- Behind the scenes: G1 and G3 pass, G4, G6 and G7 stay Partial (#354, #357, #358, #362, #363, #371, #372), the dictation audio tests wait for the write (#361), and `glama.json` (#373).

The Known limitations list in CHANGELOG.md names what the reviews left open: late first lines after a cold start, the four-core x64 line latency, a launcher left by an earlier failed launch, the silent wait in `akou quit`, and two search citation cases.

## The bump

- `scripts/stamp-version.ts --set 0.6.5` wrote the 11 stamped places.
- By hand: the install line in README.md, the image tags and the `--branch` line in docs/server.md and docs/server-hardware.md, and the "Known in" line in docs/troubleshooting.md. The menu bar item still moves, since nothing touched it after 0.6.4.
- docs/gates and docs/ROADMAP.md keep the versions their evidence ran on.
- `stamp-version.ts --check --tag v0.6.5` passes, and `--tag v0.6.6` fails as the control.

The tag is pushed after the merge.
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