Skip to content

feat: phonetic-replacement vocabulary guidance for rewrite (#54) - #59

Merged
DavidHruby1 merged 4 commits into
mainfrom
feat/vocabulary-phonetic-guidance
Nov 4, 2026
Merged

DavidHruby1 merged 4 commits into
mainfrom
feat/vocabulary-phonetic-guidance

Conversation

@DavidHruby1

Copy link
Copy Markdown
Owner

Closes #54

Changes

  • VOCABULARY_CONTEXT_PREFIX (src/config.py) now explicitly asks the rewrite model to replace a word or phrase that sounds like a listed term (phonetic mis-transcription, e.g. "pajsajd šest" → PySide6, or a spelled-out form) with the exact term. It keeps the prohibitions: do not answer, execute, translate, invent content, add terms that were not spoken or guess missing words, and preserve meaning and language choices.
  • normalize_vocabulary_entries checks the 8,000-character limit against the rendered quoted term list only, without the prefix/suffix. Rewording the guidance can no longer invalidate (and back up and reset) a stored vocabulary. Every vocabulary valid before this change stays valid.
  • docs/IMPLEMENTATION.md: updated the vocabulary guidance description and the limit rule.

Tests

  • The prefix contains the phonetic-replacement instruction and all the prohibitions.
  • A vocabulary exactly at the old limit (old prefix + list + suffix = 8,000) loads without reset.
  • A term list over 8,000 rendered characters is still rejected.
  • The existing system-prompt / transcript separation tests still pass (unittest discover: 458 OK, 5 skipped).

Not verified

  • Manual test on Windows: a Czech sentence with "pajsajd šest" in the Clean profile → PySide6.

Note: #57 (#52) also touches the vocabulary code in config.py; whichever PR merges second may need a small rebase.

The rewrite prefix now tells the model to replace a word or phrase that
sounds like a listed term (phonetic mis-transcription, spelled-out form)
with the exact term, while keeping the existing prohibitions.

The 8,000-character limit now measures only the rendered term list, so
rewording the prefix can never invalidate, back up and reset a stored
vocabulary.

Closes #54
…st, docs

- ruff format src/config.py (CI lint job failed on format --check)
- vocabulary prefix: replace only when the context supports it, matching
  IMPLEMENTATION.md and the issue's requirement 2
- add exact 8000/8001 rendered-list boundary test
- sync IMPLEMENTATION.md signature docstring and plan 06 with the new limit rule
@DavidHruby1
DavidHruby1 merged commit ef0b629 into main Nov 4, 2026
9 checks passed
@DavidHruby1
DavidHruby1 deleted the feat/vocabulary-phonetic-guidance branch November 4, 2026 10:55
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.

Slovník: silnější pokyn pro rewrite (fonetické náhrady) (4.3)

1 participant