Skip to content

feat: voice-driven compliance console (opt-in)#21

Merged
kkmookhey merged 25 commits into
mainfrom
feat/voice-console
May 6, 2026
Merged

feat: voice-driven compliance console (opt-in)#21
kkmookhey merged 25 commits into
mainfrom
feat/voice-console

Conversation

@kkmookhey

Copy link
Copy Markdown
Collaborator

Summary

Adds an optional voice-driven compliance console at python -m shasta.voice. Users run a scan via the /scan Claude Code skill, then talk to their compliance posture across SOC 2 / ISO 27001 / HIPAA / ISO 42001 / EU AI Act. Voice handles read-side queries (findings, scores, controls, scans) plus light writes (risk-register operations). Heavy operations (scans, reports, Terraform, policy generation) stay in Claude Code skills — voice redirects to them.

  • New sibling module src/shasta/voice/ (FastAPI sub-app, OpenAI Realtime API, React frontend)
  • Pre-built React bundle ships in the wheel — no Node.js required at runtime
  • Read-only over ShastaDB + risk-register writes via existing save_risk_items
  • pip install shasta[voice] extra; default install unchanged
  • 74 voice tests, ~85% coverage on src/shasta/voice/
  • Existing 426 Shasta tests still passing — no regressions

Why a voice console

Compliance posture is a query-heavy workflow (status checks, drilldowns, "what's CC6.1 looking like?"). Voice is faster than scrolling dashboards for daily check-ins and exec briefs. The dashboard cards mount in response to the assistant's tool calls, so the screen tracks the conversation hands-free.

Architecture

Browser (React, localhost:8090)  ◄── WebRTC ──►  OpenAI Realtime API
        │                                                │
        │ POST /tools/{name}            tool_call events │
        ▼                                                ▼
FastAPI sub-app (shasta.voice)
        │
        ▼
Store facade  →  ShastaDB + compliance scoring/mapper functions

The Store facade in src/shasta/voice/store.py is the only seam into Shasta core — it composes existing ShastaDB, compliance.scorer, compliance.mapper, and the ISO/HIPAA equivalents. No new domain logic; no duplication of compliance scoring.

What's in this PR

Change Files
Voice module (Python) src/shasta/voice/ — 14 modules + 14 tools across models.py, store.py, realtime_config.py, session.py, tools/*.py, app.py, cli.py, observability.py
Voice module (React) src/shasta/voice/web/ — Vite + React + TypeScript + Zustand + Framer Motion
Pre-built bundle src/shasta/voice/web/dist/ — committed for zero-Node distribution (90 KB gzipped JS)
Tests tests/voice/ — 74 tests, store + tool functions + endpoints + CLI; ~85% coverage
pyproject.toml New [voice] optional-dependency, force-include for the React bundle
src/shasta/db/schema.py One-line: check_same_thread=False on the SQLite connection (lets FastAPI share the connection across worker threads; behavior unchanged for the existing single-threaded dashboard)
CI .github/workflows/voice-bundle.yml — verifies the committed React bundle stays in sync with web/src/
Docs README.md — Voice Console section. TRUST.md — test count 632 → 706 (74 voice tests added). CHANGELOG.md[Unreleased] entry. docs/superpowers/specs/2026-05-05-shastavoice-design.md — design spec. docs/superpowers/plans/2026-05-05-shastavoice.md — implementation plan.

How to test

pip install -e ".[dev,voice]"
export OPENAI_API_KEY=sk-...   # required for OpenAI Realtime API

# In Claude Code:
/scan                          # populate data/shasta.db

# In your shell:
python -m shasta.voice         # opens browser at http://localhost:8090

Demo phrases that exercise the full surface:

  • "What's my SOC 2 score?"ComplianceScore card
  • "Show me my critical findings."FindingsList card
  • "Tell me about that one."FindingDetail card
  • "How am I doing across the board?"MultiFrameworkScore card
  • "What's CC6.1 looking like?"ControlSummary card
  • "Show me my open risks."RiskList card
  • "Add a risk for the CloudTrail thing."ActionToast confirms a new risk row
  • "Run a scan." → assistant redirects to /scan (proves the redirect rules work)
  • Try interrupting mid-response → barge-in stops within ~200ms

Test plan

  • Voice tool layer unit tests passing (74/74, ~85% coverage)
  • Tool endpoint integration tests passing
  • Existing Shasta test suite still passing (426/426 — no regressions)
  • All 15 doc-integrity tests passing (TRUST.md test count updated)
  • Manual rehearsal against real scan + real OpenAI key (user-confirmed: "this works pretty well")
  • React production build succeeds (90 KB gzipped JS bundle)

Cost note

OpenAI Realtime API: ~$0.06/min input, ~$0.24/min output. Light usage is a few cents per session. The README documents the per-minute cost so users can budget. Build + rehearsals across this PR's development consumed ~$25 in OpenAI charges.

References

🤖 Generated with Claude Code

KK Mookhey and others added 25 commits May 5, 2026 23:30
- TRUST.md: update headline test count from 632 → 706 (74 voice tests added),
  satisfies tests/test_integrity/test_doc_claims.py::test_root_trust_test_count
- CHANGELOG.md: add [Unreleased] entry documenting the voice console
  feature, the SQLite check_same_thread change, and pointers to the
  spec/plan in docs/superpowers/

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…AUDE.md

- pyproject.toml: 1.8.0 → 1.9.0
- CHANGELOG.md: rename [Unreleased] → [1.9.0] — 2026-05-05
- docs/media/shasta-voice-demo.mp4: 60-second walkthrough demo
- README.md: link the demo video from the Voice Console section
- CLAUDE.md: broaden 'What is this?' to match actual scope (HIPAA + ISO 42001
  + EU AI Act); add src/shasta/voice/ and src/shasta/dashboard/ to project
  layout; add voice install + run commands to the Commands section

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@kkmookhey kkmookhey merged commit 1a82d8e into main May 6, 2026
0 of 2 checks passed
@kkmookhey kkmookhey deleted the feat/voice-console branch May 6, 2026 16:11
oswin-mako pushed a commit to oswin-mako/shasta that referenced this pull request May 7, 2026
Rebasing onto main (post voice-console PR transilienceai#21) brings in 74 new voice
tests, pushing the total from 720 to 814. The ±50 integrity tolerance
is exceeded at 94, so update the TRUST.md TL;DR bullet to match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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