VoiceRedline — hands-free contract redlining on SuperDocs - #44
Open
vanamkarthiknetha wants to merge 1 commit into
Open
VoiceRedline — hands-free contract redlining on SuperDocs#44vanamkarthiknetha wants to merge 1 commit into
vanamkarthiknetha wants to merge 1 commit into
Conversation
A voice-driven front end for SuperDocs' human-in-the-loop editing loop: speak an edit, hear each proposed change read back, approve or reject it by voice, then export .docx. Nothing lands unreviewed. - Web Speech API for STT/TTS (Chrome/Edge), mic echo-guarded against TTS - FastAPI bridge keeps the API key out of the browser; chat_async + job polling + per-change approval, one sticky session per document - Client-side no-op detection: flags proposed changes whose before/after HTML is identical, and says so out loud - Hardened against known HITL rough edges: explicit per-change decisions, real diff always shown alongside the AI gloss, locally gated drafts - 6 offline tests (no network, no API key required) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Karthik Vanam
VoiceRedline is a voice-driven front end for SuperDocs' human-in-the-loop editing loop: you speak an edit instruction, every proposed change is read back to you and rendered as a real before/after diff, and nothing is applied until you approve it by voice — then you say "export" and get a
.docx.The pairing is the point. A voice interface makes an editing API dangerous, because you cannot proofread what you just dictated into a 40-page contract.
approval_mode: ask_every_timeis exactly the missing half: the voice makes it fast, the gate makes it safe.SuperDocs features used
Async chat editing (
/v1/chat/async), human-in-the-loop approval (ask_every_time+ per-change decisions on/v1/chat/{session}/approve), job polling, sticky multi-round sessions, and format-preserving export (docx/pdf/html/txt — also used for the free live preview).Run it
Open
http://127.0.0.1:8765in Chrome or Edge, click Load sample MSA, click the mic, and talk. Offline tests:pytest tests/ -q(6 tests, no network or key needed).Two bugs found while building this
Reported separately to hello@superdocs.app; both are worked around in the code and documented in the README.
Positional edit instructions can return a no-op change with a success gloss. "In Section 2, change the automatic renewal period from twenty-four (24) months to twelve (12) months" came back as one pending change whose
old_htmlandnew_htmlwere byte-identical — the section heading replaced by itself — withai_explanationreading "✅ I have updated the automatic renewal period…". Approving it completed the job; the document was unchanged. 2/2 runs. Rephrasing as find-and-replace targeted the correct paragraph first try. This is why the app now diffs every pending change client-side and announces no-ops out loud: a review gate whose explanations can claim a null edit succeeded is a trust problem.The approve endpoint accepts decisions for
change_ids that don't exist, and the job completes anyway — so an integrator's id-mapping bug can silently resolve a human review gate. The server here validates every decision batch against the real pending set before forwarding.Honest limits
Web Speech recognition is Chrome/Edge only (elsewhere it degrades to type-and-click, and note Chrome's STT is cloud-backed, which matters for real contracts). Single-user desk tool by design. The command grammar is a regex table, not an NLU model. Sample contract is fully fictional synthetic data.
Built with AI assistance (Claude Code), the way I actually build.