Skip to content

feat(practice): run mock interviews in the overlay, with live text and a mic gate - #79

Open
ukez15 wants to merge 27 commits into
mainfrom
main-z36vk7
Open

ukez15 wants to merge 27 commits into
mainfrom
main-z36vk7

Conversation

@ukez15

@ukez15 ukez15 commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Closes #74
Closes #77
Closes #78
Closes #84

Briefs (approved by the owner, each with a "What we adjusted" review): docs/atlas-gotcha/practice-overlay.md and docs/atlas-gotcha/practice-latency.md. The latter also records the owner's decisions after each test. This PR also carries the approved brief for #82 (practice-cloud-models.md); #82's code is in #83, which is stacked on this branch.

What changed

#74: practice in the overlay

  • Mock interviews show the practice panel in the existing transparent overlay instead of the answer assistant. The panel adds a mic status line, and its text wraps to fit the 440×360 window.
  • The main window shows "Practising in the overlay." and the attempt history, reloaded whenever the window regains focus.
  • Once scored, "Your answer" shows the exact text that was scored.
  • The overlay scrolls itself. In a mock interview it follows new text, but pauses while you've scrolled up (within 24 px of the end counts as the bottom). On a live call it always jumps to the newest text.

#77: CSP blocked the events WebSocket

  • index.html's connect-src now lists ws://127.0.0.1:5480. Without it there was no live transcript and no auto-answers in the overlay. A test guards it.

#78: faster practice, no stale speech, nothing scored unseen

  • Mic gate: in a mock interview, mic frames are dropped while no question is open, so Whisper doesn't compete with the model for the CPU. Every frame is numbered on arrival, so segment times are true stream positions. Speech that started before the question appeared is ignored (answerFromMs). Skipping a question closes it at once. The mic line says "Mic ⏸ Paused until the question is complete" meanwhile.
  • Smaller question prompt: questions include at most 2,000 characters of documents on the local model, down from 6,000. Cloud models, scoring and live answers keep 6,000.
  • Word-by-word question: POST practice/next streams like live answers: delta events, then done with {question, answerFromMs}, or error. Live answers and practice share one relay, LlmEventStream.
  • Streamed score: POST practice/finish streams too: score once its line is written, delta for each piece of feedback, restart if an unreadable reply is asked again, then done with the saved attempt, or error. A failed or abandoned score keeps the answer for another try.
  • Scores after 6 s of no voice: the worker reports each handled frame with where the voice last ended. Once the candidate said something, everything is transcribed and 6 s pass with no voice, PracticeSilenceWatcher sends practice.silence and the overlay scores. This replaces the 4 s text timer, which cut answers short while Whisper was still working.
  • Waits for your last words: "Done answering" waits up to 5 s, with the question still open, until transcription catches up with the moment you clicked. The overlay keeps showing lines while scoring. Deepgram sessions skip the wait.
  • No noise labels: Whisper segments that are only labels such as "(mumbles)" or "[BLANK_AUDIO]" are dropped, in every mode.
  • The mode, ownership and live checks, and "No answer heard.", still return 400, 404 and 409 before either stream starts.

#84: a session left Live after closing the app couldn't be deleted

  • However the app quits, the desktop app first ends the session it is capturing, like clicking "End session". It's best effort: no sign-in, an error, or a backend that doesn't answer within 2 s never blocks the quit.

Also on this branch: merges of main (#76, #81), so they drop out of the diff.

Checks:

  • UI: 261 tests pass, coverage 98.6%. Desktop: 76 tests pass, coverage 97.7%. Lint and typecheck are clean.
  • The backend tests run in CI only, because the .NET SDK can't download in the cloud session.

The owner's tests on Windows:

  • Done so far: questions went from about 90 s to about 20 s, the answer shows, and "Done answering" works.
  • To check on the next installer: the paused mic line, the streamed score, and ending the session on quit.

Checklist


Generated by Claude Code

ukez15 and others added 19 commits October 26, 2026 19:08
Records that v1 is feature-complete on Windows, which epics stay open, the FluentAssertions ignore rule, the first real release.yml run on the new Actions majors, the deny-licenses deprecation, and the garbled @dependabot command gotcha. Removes PROGRESS.md, which asked to be deleted once read.

Refs #72
Mock interview sessions now show the practice panel in the existing overlay window instead of the answer assistant, with a mic status line so a mic that isn't heard is visible. The main window shows 'Practising in the overlay.' and the attempt history, reloaded on focus. Capture status polling moves into a shared useCaptureStatus hook.

Refs #74
The packaged app spawned InterviewCopilot.Api without a working folder, so ASP.NET never loaded the appsettings.json next to the exe. Its CORS allow-list was then empty and every UI request from app://interview-copilot was rejected, which the UI reports as 'Can't reach the InterviewCopilot backend'. The health probe isn't subject to CORS, so no error showed.

Closes #75
connect-src listed http://127.0.0.1:5480 but not ws://127.0.0.1:5480. Under CSP Level 3 an http: source doesn't match a ws: URL, so the session events socket was blocked: no live transcript in mock interviews and no auto-answers in the live overlay, with nothing shown to the user.

Refs #77
After scoring, 'Your answer' shows the exact text that was marked. The overlay follows new text: in a mock interview it pauses while the user has scrolled up, and on a live call it always jumps to the newest text. Brief updated with the owner's decisions.

Refs #74
…open

Whisper kept transcribing the mic between questions, competing with Ollama for the CPU, and late segments spoken before the question counted as the answer. Frames are now numbered on arrival so segment times are true stream positions; a capture gate drops mock-interview candidate audio while no question is open; the question returns answerFromMs and both the collector and the overlay ignore speech that started earlier. The worker ends a segment at a gap instead of stitching audio from two moments.

Refs #78
Importing the Audio test namespace into the practice tests made InMemoryPreferences ambiguous (CS0104).

Refs #78
A reconnected stream must start its segment times at 0, as before. The sink now forgets a session's frame counters when its stream ends, which also stops them growing without bound.

Refs #78
…question

The local model reads the whole prompt before it writes. At about 41 tokens/s on the
owner's machine, 6,000 document characters took about 37 s. Scoring and the live
assistant keep 6,000.

Refs #78
POST practice/next now streams server-sent events like live answers: "delta" for
each piece of the question, then "done" with the question and answerFromMs, or
"error" if the model fails part-way. Ownership, mode and live checks still answer
404, 400 and 409 before the stream starts.

The question opens for the answer only once it is complete, and a skipped question
closes as soon as the next one is asked, so the mic rests while it is written. The
relay loop is shared with live answers in LlmEventStream.

Refs #78
Cloud models read prompts fast, so they keep the full 6,000-character document
budget. Practice runs on Ollama in this wave, so today every question keeps the
2,000 limit; the rule is in place for when practice can use cloud models.

Refs #78
"Done answering" often comes as the candidate stops talking, while the last
sentence is still in the speech buffer or in Whisper. The worker now records how
far each speaker's stream is transcribed, and finishing waits, with the question
still open so the mic keeps listening, until transcription reaches the moment of
the click or 5 s pass. Deepgram sessions have nothing queued locally and don't wait.

Refs #78
@ukez15
ukez15 marked this pull request as ready for review October 27, 2026 11:52
…t is scored

The overlay scored once 4 s passed without a new transcript line. Lines only
arrive after a pause plus a few seconds of Whisper on the CPU, so answers were
cut short. The worker now reports each handled frame with where the voice last
ended, and a practice watcher announces practice.silence once the candidate said
something, everything is transcribed and 6 s pass with no voice.

The overlay keeps adding lines while the answer is scored, so nothing is scored
unseen. It also says the mic listens once the question is complete. Whisper's
noise labels such as "(mumbles)" and "[BLANK_AUDIO]" are dropped in every mode.

Refs #78
The mic line said "Listening" while the question was being written, although
the backend ignores the mic until it's complete. It now reads "Mic ⏸ Paused
until the question is complete" and replaces the separate hint. A mic problem
still shows.

Refs #78
A session left Live when the app closed couldn't be deleted until it was
opened and ended by hand. However the app quits, it now ends the session it
is capturing first, like clicking End session. Best effort: no sign-in, an
error or a backend that doesn't answer within 2 s never blocks the quit.

Closes #84
Scoring takes 60-120 s on a CPU, with nothing to read until the end. POST
practice/finish now streams like practice/next: "score" once its line is
written, "delta" for each piece of feedback, "restart" if an unreadable reply
is asked again, then "done" with the saved attempt, or "error". The checks
and "No answer heard." still answer before the stream starts. A score that
fails, or that the overlay stops reading, keeps the answer for another try.

Refs #78
Sonar S1751 rejects a loop that always breaks on its first pass. The test now
reads the first part with the enumerator and disposes it, as a client that goes
away would. The reader test uses LINQ instead of an add-only loop.

Refs #78
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants