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

@@ -1,6 +1,6 @@
{
"name": "@mobiletic/anonymizer",
"version": "0.3.0",
"version": "0.3.1",
"description": "Framework-agnostic PII anonymization & pseudonymization: pluggable LLM detection for free-form PII (names, addresses) with a deterministic regex fallback, deterministic coreference, and streaming-safe de-anonymization.",
"license": "MIT",
"author": "Mobiletic",