Skip to content

feat: S5 — silence timeout (the quiet seal) - #35

Merged
anchildress1 merged 4 commits into
mainfrom
feat/s5-silence-timeout
Jun 12, 2026
Merged

anchildress1 merged 4 commits into
mainfrom
feat/s5-silence-timeout

Conversation

@anchildress1

Copy link
Copy Markdown
Owner

What

S5 (R7): five seconds with no recognizable player speech idles the voice session back to asleep — mic stops streaming, socket closes, medallion sleeps. Silently: no error event, no notice, no audio nudge.

How the clock behaves

  • Recognizable speech = server input transcripts, never the local RMS signal — a fan or a cough flares the corona but never holds the session awake (the deferred S2 contract)
  • Clock restarts on listening, rides through hearing without restarting, and arms fresh after a barge-in cuts straight from speaking
  • Pauses through thinking and speaking — the Oracle's own voice never counts as the player's silence (R7 clause 2)
  • A transcript fragment landing in thinking does not arm a clock the Oracle's turn owns
  • Medallion tap resumes via the existing wake(); silence-idle is a full sleep, so each resume mints a new rate-limited token by design

Tests

13 new cases in the S5 describe block: idle teardown + tee, silent-by-design assertions, transcript resets from both listening and mid-hearing, RMS non-reset, speaking/thinking pauses, drain handoff, barge-in arming, thinking-rescue handoff, post-idle resume, and sleep clearing the clock. One existing rescue test updated — 10s of post-turn silence now legitimately idles at the 5s mark.

make ai-checks green: 879 tests, voiceSession.ts at 99.7% stmts / 96.6% branches. Semgrep + Sonar clean. Also rides along: one ttd line (architecture diagrams).

🤖 Generated with Claude Code

- add the R7 silence clock to voiceSession: 5000ms with no recognizable
  player speech tears the session down to asleep — mic stops streaming,
  socket closes — silently, with no error event, notice, or audio nudge
- recognizable means a server input transcript; the local RMS signal
  (coughs, fans) keeps the corona flaring but never resets the clock
- the clock runs only on the player's turn: restarts on listening,
  rides through hearing, arms fresh after a barge-in cut from speaking,
  and pauses through thinking and speaking so the Oracle's own voice
  never counts as the player's silence
- a medallion tap resumes via the existing wake(); silence-idle is a
  full sleep, so each resume mints a new rate-limited token by design
- tests: idle teardown, transcript resets (listening and mid-hearing),
  RMS non-reset, speaking/thinking pauses, barge-in arming, rescue
  handoff, post-idle resume, and sleep clearing the clock

Generated-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Ashley Childress <6563688+anchildress1@users.noreply.github.com>
Commit-generated-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Ashley Childress <6563688+anchildress1@users.noreply.github.com>
- component suite: Enter and Space fire onToggle like a tap, and the
  eclipsed seal swallows keyboard activation as it does the pointer
- a11y e2e: the medallion carries the same 2px gold focus outline as
  the rune cards — asserted with the full theme CSS loaded, where a
  missing --gold-bright would silently void the ring

Generated-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Ashley Childress <6563688+anchildress1@users.noreply.github.com>
…is S13's

Commit-generated-by: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Ashley Childress <6563688+anchildress1@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 12, 2026 11:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements S5 (R7) “silence timeout” behavior for the voice session: after 5s with no recognizable player speech (server input transcripts), the session silently idles back to asleep by stopping mic streaming, closing the socket, and sleeping the medallion—without emitting error/notice/audio nudges.

Changes:

  • Add a 5s silence clock to voiceSession that runs only on the player’s turn (active in listening, armed once in hearing, paused in thinking/speaking) and resets only on server input transcripts.
  • Add/adjust unit tests covering idle teardown, transcript-driven resets, RMS non-reset, speaking/thinking pauses, barge-in arming, rescue interplay, and post-idle resume; plus a11y/keyboard activation coverage for the medallion.
  • Update docs checklists to mark S5 complete and add an architecture-diagrams TODO.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/voice/voiceSession.ts Adds the SILENCE_TIMEOUT_MS clock, state-based arming/pausing, transcript-driven resets, and silent idle teardown to asleep.
tests/lib/voice/voiceSession.test.ts Adds a comprehensive S5 test suite and updates an existing rescue test to account for the new 5s idle behavior.
tests/lib/components/EclipseMedallion.svelte.test.ts Adds keyboard activation tests (Enter/Space) and verifies eclipsed-state blocks keyboard activation too.
tests/e2e/a11y.e2e.ts Ensures the medallion receives a visible keyboard focus outline in the fully themed app.
docs/v2-implementation-checklist.md Marks S5 items as completed with clarified “recognizable speech” definition and turn-ownership behavior.
docs/ttd.md Adds a new TODO line for architecture diagrams.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sonarqubecloud

Copy link
Copy Markdown

@anchildress1
anchildress1 merged commit d53f288 into main Jun 12, 2026
6 checks passed
@anchildress1
anchildress1 deleted the feat/s5-silence-timeout branch June 12, 2026 11:56
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.

2 participants