feat: prompt rules for lossless round-trips (0.3.1)

Two coherence rules added to DEFAULT_SYSTEM_PROMPT:
- different values of the same type get distinct placeholders (context),
  e.g. old/new IBAN -> [PER_1.IBAN:Ancien] / [PER_1.IBAN:Nouveau]
- never absorb adjacent punctuation/separators into a placeholder

Took the live Gemma-4 (Infomaniak) e-learning demo from 4/5 to 5/5 exact
round-trips. 36 tests passing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mobiletic
2026-07-01 09:58:56 +01:00
parent f5c9f0fbd4
commit 2584bd8c95
3 changed files with 13 additions and 2 deletions

View File

@@ -4,6 +4,16 @@ All notable changes to this project are documented here. The format is based on
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.3.1] - Unreleased
### Changed
- Default prompt hardening for lossless round-trips: (1) two **different** values of the same type never
share a placeholder — they must be distinguished by context (e.g. `[PER_1.IBAN:Ancien]` vs
`[PER_1.IBAN:Nouveau]`), preventing a within-message collision (old/new IBAN); (2) the model must not
absorb adjacent **punctuation/separators** (commas, spaces, parentheses) into a placeholder. Together
these took the live Gemma-4 e-learning demo from 4/5 to 5/5 exact round-trips.
## [0.3.0] - Unreleased
### Changed