Repository navigation
fix(voice): prefer a run-together compact over a shorter two-word match - #613
Merged
Merged
Conversation
The matcher returned the longest spoken form before it looked at words that run together into a term, so 'clark cant web' matched the two-word ClarkCant and left 'web' behind instead of matching the package clarkcant-web. An exact match of either kind now wins by length, a form wins a tie, and a near match is still tried only when no exact match starts there.
Contributor
Author
|
Review attestation: ready to merge at A push to this PR makes this attestation stale; the new head needs its own review. |
mrgoonie
enabled auto-merge (squash)
October 7, 2026 21:36
mrgoonie
added a commit
that referenced
this pull request
Oct 8, 2026
… the sentence (#627) * fix(voice): count the words a run-together term absorbed as code evidence for the sentence When words ran together into a longer term, the shorter exact form they passed over no longer anchored the rest of an English sentence, so ClarkCant and React beside a run-together webapp were left as heard. The passed-over form and the exact matches inside the span now count as evidence, as they would on their own; they still never support the run-together span itself. Refs #608, #613 * fix(voice): keep two run-together spans from vouching for each other A word a run-together term absorbed now supports only spans that did not absorb a word themselves. Such a span is rewritten only on a technical cue or a term heard in its own spelling, so "the web app and the web app" and "set up the web app for grandma" stay as heard, while "fix the clark cant web app now" still gives ClarkCant and "fix the web app react now" still restores React. * fix(voice): keep a rewritten evidence term from leaning on a word it let a span absorb A term that counts as evidence while it is itself rewritten, such as "Follow-up" heard for the tool follow-up or "S3" for s3, supports a run-together span that absorbs a word like "web". That absorbed word no longer supports lowering the term in return, so "Follow-up on the web app" keeps "Follow-up" as main does, instead of each change resting only on the other. * fix(voice): keep absorbed words from supporting a span that holds evidence itself A span that holds a coding cue or an evidence term already supports every run-together span outside it, so the words those spans absorbed are rewritten away. They no longer support that span in return: "the code review of the web app" keeps "code review" and "type script web app" keeps "type script", as main does.
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.
Summary
matchAtin the transcript normaliser returned the longest spoken form before it looked at compacts (words that run together into a term). So "clark cant web" matched the two-wordClarkCant/clarkcantand left "web" behind, even thoughclarkcant-webmatched all three words.Now an exact match of either kind wins by length:
Compacts are still limited to three words, and command terms are still never matched as compacts.
Behaviour
Vocabulary
buildRecognitionContext({ repositories: ["ClarkCant"], packages: ["clarkcant", "clarkcant-web"] }):sửa clarkcant-web trướcClarkCant/clarkcant)Tests
New tests in
packages/voice-adapters/test/transcript-normalizer.spec.ts, under "words that run together into a longer term than a form starting the same way":sửa clarkcant-web trước. Fails on main.ClarkCant/clarkcant.I ran the new spec against main's
transcript-normalizer.ts: 2 failed, 41 passed. On this branch all 43 pass.Corpus bench
corepack pnpm --filter @clarkcant/voice-adapters bench:transcriptiongives identical results on main and on this branch:The ADR-003 tables (EN and VI) already show these numbers, so they need no change.
Verification
vitest run packages/voice-adapters: 163 passedpnpm typecheck: passedpnpm invariants: all 14 checks passedpnpm verify: passed (568 files, 7663 tests passed)No official docs change: this is an internal correctness fix to the normaliser.
Fixes #608
Refs #590, #607