Skip to content

feat: with the clause decider on, vocabulary needs only the parser and checks rule places too - #379

Merged
znat merged 9 commits into
feat/syrinx-disfluencyfrom
feat/vocab-syrinx-slots
Nov 2, 2026
Merged

znat merged 9 commits into
feat/syrinx-disfluencyfrom
feat/vocab-syrinx-slots

Conversation

@znat

@znat znat commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

With transcription.vocabulary.clause_decider: true (default false), the vocabulary stage now needs only parrotflow-syrinx. The slot type check reads the parser instead of mmBERT, the Qwen slot gap is gone, and mmbert-small-64 and qwen3-embedding are no longer fetched, warmed or read. Rule places now get the same slot check as sound places, an offered rule place shows the heard word with the term on the pill, and keeping the heard word on the pill no longer creates a term. A clause close to a term's refused sentences now pushes the decider toward leaving. Flag off is unchanged. The possessive sound forms of the first version are reverted.

41-dictation trial replay, from a blank vocabulary Right writes Wrong writes Offers Misses Corrections
Flag off 17 6 0 12 18
Flag on, first version of this PR 16 3 7 11 14
Flag on, before sim_ref 19 3 8 7 10
Flag on, now 19 3 4 7 10
What changed on the flag-on path, and why
  • Slot type on the parser. The heard words become one <mask> in their parse window; a slot tagged VERB, AUX, ADV or ADP refuses the term. VocabularyPass.settle takes the slot as a closure, so mmBERT (flag off) and the parser (flag on) share one call site.
  • No slot gap, no word vectors. Config.readsSlots, readsSentenceGate, readsPortraits are false with the flag on. Without a clause session (French, or the parser not ready) places stay open.
  • Rule places get the slot check (Gating.slot). A heard word in neither word list (Versal, Pracy) is still written at once. Otherwise the slot is asked, and a refusal puts the heard word back.
  • An offered rule place shows the heard word, and the term waits on the pill. The old code kept a rule's write because a refusal silently undid a lesson the user could not get back. With the term on the pill, one answer gets it back.
  • Keeping the heard word on the pill is a counter under every offered term, and nothing is written to vocabulary.yaml. Keeping "Versailles" had created a term, and a heard "Versailles" was then never a place for Vercel again.
  • sim_ref counts, one way. The closeness of the clause to a term's refused sentences had a fitted weight of -0.06, so a castle clause was offered as Vercel even with castle sentences refused. It now has a hand-set weight of -0.94, and its contribution is min(0, w(x - mu)/sd): a match can only push toward leaving. An absent sim_ref adds nothing. The one-sided form was chosen after scoring: the two-sided weight wrote red rock as Redrock on the bench, because a low match with one off-topic refusal pushed toward writing. A feature may only push the way its meaning allows, like the fixed signs on the others. The weights file names the clamped feature in its one_sided metadata.
  • A past correction counts only when the clause agrees. In a single-term place, the +2 for an earlier correction of the same word counts only when sim_acc is present and at least its mean (0.198). Live, a correction made in a deploy sentence wrote Vercel over a castle's "Versailles" (sim_acc 0.061). A refusal still always counts. Shared places (groups_v3) are unchanged. The weights file turns this on with its pair_gate metadata.
  • The pill asks after a case-only rewrite. An open place is found in the landed text regardless of case, so a later stage that wrote "versailles" no longer silences the question, and a keep records the refusal. Flag off still matches case exactly.
  • Possessive sound forms reverted. A two-word possessive window won the span even when it scored lower than the one-word match, and the slot then refused it, so the single word was never tried.
Trial replay by half: misses drop from 11 to 7, wrong writes stay at 3

Flag on, now:

Items Right Wrong Offered right first Offered wrong first Misses Corrections Picks
1-19 9 1 2 0 4 5 2
20-41 10 2 1 5 3 5 6

With sim_ref, items 24, 25, 26 and 30 change: the castle is left instead of offered as Vercel (p 0.05 to 0.10). The deploy places stay written (p 0.85 to 0.99). Before sim_ref, items that changed against the first version: 9 and 19 (offered instead of missed or written), 12 (no offer), 13, 14 and 18 ("praise" left as heard instead of a rule write on the pill), 23, 25, 26 and 30 (Vercel written; the castle is offered and kept), 24 (castle offered), 27, 34 (the possessive reading is gone, so missed). The 5 wrong-first offers are all the castle, kept on the pill. One right-first offer covers only one word of a two-word possessive, so picking it does not give the possessive. Flag off is identical to before.

The 165-decision replay: wrong writes do not rise

All 165 places, right writes / wrong writes / right leaves / wrong leaves / offers; random = mean over 20 orders.

Arm 0.85 chrono 0.85 random ww 0.60 chrono 0.60 random ww
#378 head (mmBERT slot, gap on) 49/2/93/16/5 2.35 54/2/87/6/16 2.55
this PR before sim_ref 49/2/93/16/5 2.00 54/2/87/7/15 2.15
this PR, one-sided sim_ref 49/2/93/16/5 2.00 54/2/87/7/15 2.05
this PR, + correction gate 48/2/93/16/6 2.00 53/2/87/7/16 2.05

The correction gate turns one early write into an offer (bench item 44, Redcrawl), in both orders: right writes 49.0 -> 47.75 at 0.85 random, 51.9 -> 50.6 at 0.60. Wrong leaves are unchanged.

Wrong leaves at 0.60, random: 7.5 before sim_ref, 7.65 after. The two-name toy (24 places): 16 written right, 7 offered, 1 written wrong before; 16 / 8 / 0 after.

The replay does not tell rule places from sound places; it already asked the slot of every place the word lists did not write.

Slot harness and probes

Judge set, 50 English cases, declines right / wrong: mmBERT 15 / 0, parser 12 / 1. The Swift reading matches the Python reference on all 50. The one wrong decline is a name after "that" before a past verb, read AUX.

The issue probe set, 12 sentences, flag on: one-word matches win again (Versal written, Pracy written); known words (Praise, Meek, Andre) are offered with the heard word shown; "Andre his" is refused (ADV); "the fix" is no longer offered as Mik's.

How it was checked
  • The live castle sentence, with the vocabulary and uses as they were (kept local, not committed): the previous weights write Vercel over the castle; now "Versaill" is written as Vercel and the castle's "Versailles" is offered (z -0.26), so the heard word stays.
  • scripts/check-clause-places.sh (new, needs the parser): 9/9, including the case-only selector. Pill answer keeps no term with the flag on and still creates it with the flag off; a slot refusal puts the heard word back; a word in neither list is written; an offered rule place shows the heard word.
  • scripts/check-clause-decider-parity.sh: 44/44, including the 17 UPOS probabilities at the mask, three cases where the sim_ref clamp is active, and a case where the correction gate bites and one where it does not.
  • scripts/check-vocabulary-config.sh: 66/66, flag on reads only parrotflow-syrinx.
  • Flag off, --pipeline on 32 runs (sound and rule fixtures, floors 0.85 and 0.60), feat: the parser clause can decide a vocabulary place, behind a flag #378 head against this branch: identical.
  • CodeRabbit local review: 5 findings over four rounds (none in the last), 3 fixed (group counters released each other, reverted missed shown words, and a trim bug in the code since reverted), 2 declined: keep the old models for French with the flag on, and a castle fixture the shared-place policy writes as Vercel (unchanged since feat: the parser clause can decide a vocabulary place, behind a flag #378's last commit, follow-up below).
Follow-ups, not in this PR
  • A correction in a sentence that names both members of a group (Mick and Mik) is blocked, so the same wrong write repeats.
  • The clause decider's known feature reads /usr/share/dict/words, a third word list next to the spell checker and the tokenizer.
  • The shared-place fixture group-castle-deploy-rows writes Vercel in the castle clause (since feat: the parser clause can decide a vocabulary place, behind a flag #378's last commit; the member with no sentences cannot hold the place).
  • A refused rule place puts back the rule's source spelling, not the heard casing ("praise" can come back as "Praise").

🤖 Generated with Claude Code

https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2

znat and others added 3 commits October 28, 2026 20:31
…cider on

With transcription.vocabulary.clause_decider on, the vocabulary gate asks
parrotflow-syrinx what the slot wants instead of mmBERT. The heard words
become one <mask> in their parse window, the window is parsed again, and a
slot tagged VERB, AUX, ADV or ADP refuses the term.

VocabularyPass.settle now takes the slot as a closure, so the mmBERT gate
and the parser share one call site. Flag off is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
…use decider on

Replayed over the 165 bench decisions, the slot gap changes no wrong write
with the clause decider on: chrono equal at 0.85 and 0.60, random 2.4
against 2.55 at 0.60. So with the flag on the sentence gate no longer asks
SlotReference, and nothing reads Qwen3-Embedding or mmBERT.

Config.readsSlots, readsSentenceGate and readsPortraits are false with the
flag on, so the launch fetch, the warm-ups and the portrait rebuild skip
both models. Without a clause session (French, or the parser not ready)
the places stay open instead of falling back to the portrait.
--check-config names the models the vocabulary reads, and
check-vocabulary-config.sh holds it to parrotflow-syrinx alone.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
With the flag on, the sound pass also compares each term form with its
possessive reading (/ɪz/ after a sibilant, /s/ after a voiceless sound,
/z/ otherwise), and a weak word after the first (he, his, him, her, has,
have, had) may lose its leading /h/. "praise his" now reaches Praisy's at
0.86 and "Prise's" at 0.71. A match on a possessive form writes Term's and
stays under the base term, so nothing is added to vocabulary.yaml.

The clause decider's sound feature and the edge trim score the same way,
and the trim keeps the last word of a possessive heard as "X his". The
parser slot still refuses "We should praise his work" (VERB).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 28, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository.

@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c011a80f-1b9d-448f-b00a-23a06e1fd421
Commits

Reviewing files that changed from the base of the PR and between eb6d776 and 1ede563.

Files selected for processing: 20
  • Sources/ParrotFlow/AppDelegate.swift
  • Sources/ParrotFlow/CheckConfigCommand.swift
  • Sources/ParrotFlow/ClauseDecideCommand.swift
  • Sources/ParrotFlow/ClauseDecider.swift
  • Sources/ParrotFlow/Config.swift
  • Sources/ParrotFlow/CorrectionRecording.swift
  • Sources/ParrotFlow/OpenPlaces.swift
  • Sources/ParrotFlow/Pipeline.swift
  • Sources/ParrotFlow/SelectorCommand.swift
  • Sources/ParrotFlow/SoundGroupCommand.swift
  • Sources/ParrotFlow/TermUses.swift
  • Sources/ParrotFlow/VocabularyPass.swift
  • built-in/data/vocab-clause.safetensors
  • docs/cli.md
  • docs/configuration.md
  • scripts/check-clause-decider-parity.sh
  • scripts/check-clause-places.sh
  • scripts/check-vocabulary-config.sh
  • scripts/clause-decider-reference.py
  • tests/clause-decider-parity.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

znat and others added 3 commits October 29, 2026 09:25
This reverts commit 6efed9c. A two-word possessive window claims the
span even when it scores lower than the one-word match ("Versal has" 0.79
against "Versal" 1.00). The slot then refuses the window and the single
word is never tried. It also offered "the fix" as Mik's (0.75).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
… the clause decider on

With the flag on, a pill answer that keeps the heard word is a counter
under every term the pill offered, and nothing is written to
vocabulary.yaml. In the trial replay, keeping "Versailles" created the
term Versailles, and a heard "Versailles" was never a place for Vercel
again (4 misses). Flag off still creates the name.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
…rd when offered

With the clause decider on, a rule's write is no longer settled by the
word lists alone. A heard word in neither list ("Versal", "Pracy") is
still written straight away. Otherwise the parser slot is asked, and a
refusal puts the heard word back: "We should praise his work" no longer
becomes "We should Praisy his work". When the clause decider offers a
rule place, the text shows the heard word and the term waits on the pill.

The old reason to keep a rule's write was that a refusal silently undid a
lesson the user could not get back. With the term on the pill, it can be
got back with one answer.

scripts/check-clause-places.sh checks the pill answer, the slot refusal,
the word-list shortcut and the offer.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
@znat znat changed the title feat: with the clause decider on, vocabulary needs only the parser and hears possessives feat: with the clause decider on, vocabulary needs only the parser and checks rule places too Oct 29, 2026
znat and others added 3 commits October 29, 2026 10:16
…toward leaving

sim_ref, the closeness of the clause to a term's refused sentences, had a
fitted weight of -0.06, so it did nothing: "Versailles" in a castle clause
was offered as Vercel even with castle sentences refused. It now has a
hand-set weight of -0.94, the mirror of sim_acc, and it is one-sided: its
contribution is min(0, w(x - mu)/sd), so a match can only push toward
leaving. An absent sim_ref adds nothing. No other weight changes.

One-sided was chosen after scoring. The two-sided weight let a low match
with one off-topic refusal write "red rock" as Redrock on the bench. A
feature may only push the way its meaning allows, like the fixed signs on
the others.

The weights file names the clamped features in its "one_sided" metadata;
the Swift scorer and the Python reference both read it. Parity 42/42,
three cases with the clamp active.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
In a single-term place, the +2 for a past correction of the same word now
counts only when sim_acc is present and at least its mean (0.198). Live, a
correction Versailles -> Vercel made in a deploy sentence wrote Vercel over
the "Versailles" of a castle clause (sim_acc 0.061, p 0.851). Without the
bonus that place is offered, which on a rule place keeps the heard word.

A refusal still always counts. Shared places are unchanged. The weights
file turns the gate on with its "pair_gate" metadata; the Swift scorer and
the Python reference read it. Parity 44/44, with a case where the gate
bites and one where it does not.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
…er case

With the clause decider on, an open place is found in the landed text
regardless of case. Context spelling had rewritten "Versailles" as
"versailles", so the pill was not asked and a keep never recorded the
refusal. A keep now writes the word as it landed and records the counter.

Flag off still matches case exactly. A keep there writes the landed slice,
which is the same text whenever the match is exact.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01WfxPEjc1EEGqG2rHoJcLJ2
Signed-off-by: Nathan Zylbersztejn <[email protected]>
@znat

znat commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Base automatically changed from feat/vocab-clause-decider to feat/syrinx-disfluency November 2, 2026 07:22
@znat

znat commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@znat

znat commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

CodeRabbit review (local CLI 0.8.0). The GitHub app is rate limited on this repository, so this review ran with coderabbit review --agent --base-commit 6b6fff98 (the diff against #378). 2 findings, both minor, both dismissed:

  1. scripts/check-clause-places.sh:55: "check that the fixture's top-level clause_decider key reaches transcription.vocabulary.clause_decider." It does. PipelineCommand decodes it (line 74) and sets config.transcription.vocabulary.clauseDecider = fixture.clauseDecider (line 142).
  2. Sources/ParrotFlow/SelectorCommand.swift:74: "make every caller of --selector set PARROTFLOW_CONFIG_DIR." Its only caller, scripts/check-selector.sh, already exports PARROTFLOW_CONFIG_DIR to a mktemp -d folder (line 34). feat!: the clause decider is the only vocabulary path #386 later removes the config read's flag dependence.

@znat
znat merged commit d1702d0 into feat/syrinx-disfluency Nov 2, 2026
8 checks passed
@znat
znat deleted the feat/vocab-syrinx-slots branch November 2, 2026 07:57
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