While a tool-permission gate is held on the active tab, spoken confirm phrases resolve it via the existing approve/reject WS channel — no server change (byte-shuttle intact). Everything else stays ordinary dictation. Safety: whole-utterance-exact matching + leading-negation guard + reject precedence + confidence gate (approve only) + a cancellable 1.5s confirm window whose commit re-validates gate identity/epoch/connectivity (TOCTOU guard) + stale-gate epoch bound at PTT-start. New pure modules public/voice-commands.ts and public/voice-confirm.ts at 100% coverage; wiring in voice/terminal-session/tabs/main. 1307 tests pass, typecheck clean, build:web OK. Independent code + security reviews flagged a confirm-window TOCTOU and an unwired cancel path — both fixed and covered. Plan: docs/PLAN_VOICE_COMMANDS.md.
37 lines
1.3 KiB
TypeScript
37 lines
1.3 KiB
TypeScript
import { defineConfig } from 'vitest/config'
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
include: ['test/**/*.test.ts'],
|
|
environment: 'node',
|
|
// Scaffold has no tests yet; don't fail the script until modules add theirs.
|
|
passWithNoTests: true,
|
|
// Coverage target is the global 80% rule; enforced with `--coverage`.
|
|
// Scope: all backend src/** (the review's core), plus the frontend modules
|
|
// that carry real logic and have unit tests. The remaining public/*.ts are
|
|
// thin DOM-wiring / entry-point glue (main.ts boots the app; dashboard/qr/
|
|
// share/shortcuts/search/keybar/settings/history just build + wire DOM) with
|
|
// no branch logic worth unit-testing in this fix-pass — excluded so the
|
|
// threshold measures tested surface, not untestable wiring. (Browser-driven
|
|
// E2E, not unit tests, is the right tool for those.)
|
|
coverage: {
|
|
provider: 'v8',
|
|
include: [
|
|
'src/**/*.ts',
|
|
'public/terminal-session.ts',
|
|
'public/tabs.ts',
|
|
'public/preview-grid.ts',
|
|
'public/title-util.ts',
|
|
'public/voice-commands.ts',
|
|
'public/voice-confirm.ts',
|
|
],
|
|
thresholds: {
|
|
lines: 80,
|
|
functions: 80,
|
|
branches: 80,
|
|
statements: 80,
|
|
},
|
|
},
|
|
},
|
|
})
|