solidprivacy-nl commited on
Commit
1f5e008
·
1 Parent(s): 4334fb3

Add explicit project changelog

Browse files
Files changed (1) hide show
  1. CHANGELOG.md +397 -0
CHANGELOG.md ADDED
@@ -0,0 +1,397 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Changelog — SolidPrivacy Scrub
2
+
3
+ This changelog records meaningful product, architecture, workflow and recognizer changes for the Scrub legal document scrubber.
4
+
5
+ Conventions:
6
+
7
+ - Keep this file explicit and human-readable.
8
+ - Group changes by project phase / version.
9
+ - Record what changed, why it changed, and what is intentionally not changed.
10
+ - Do not use this as a substitute for tests; every recognizer hardening step should also add or update regression tests.
11
+
12
+ ---
13
+
14
+ ## Current development rule
15
+
16
+ From v10 onward, recognizer work follows this order:
17
+
18
+ 1. Add or update synthetic regression cases.
19
+ 2. Add or update tests.
20
+ 3. Change recognizer / scanner logic.
21
+ 4. Verify GitHub Actions tests are green.
22
+ 5. Let GitHub sync to Hugging Face automatically.
23
+ 6. Test the app in Hugging Face.
24
+
25
+ This prevents one-off fixes and protects existing behaviour.
26
+
27
+ ---
28
+
29
+ ## v11.2 — Dutch recognizer integration tests
30
+
31
+ Status: completed and green in GitHub Actions.
32
+
33
+ Purpose:
34
+
35
+ - Prove that the real Dutch recognizer layer works, not only the candidate scanner / audit layer.
36
+ - Test recognizer output at value/span level.
37
+ - Confirm that context labels remain readable and are not swallowed into the sensitive span.
38
+
39
+ Files added or changed:
40
+
41
+ - `.github/workflows/tests.yml`
42
+ - `tests/test_dutch_recognizers_integration.py`
43
+
44
+ Main changes:
45
+
46
+ - Added lightweight recognizer integration tests using `get_dutch_recognizers()` directly.
47
+ - Verified that v11.1 legal reference values are detected by the actual recognizers.
48
+ - Verified expected entity types for values such as:
49
+ - `10598721 / UE VERZ 26-441` → `NL_LEGAL_CASE_NUMBER`
50
+ - `INC-2026-0912` → `NL_INCIDENT_NUMBER`
51
+ - `CAM-MAAS-2026-0518` → `NL_OTHER_REFERENCE`
52
+ - `CLM-2026-112233` → `NL_CLAIM_NUMBER`
53
+ - `REP-2026-4410` → `NL_OTHER_REFERENCE`
54
+ - `ARN 26/4412` → `NL_LEGAL_CASE_NUMBER`
55
+ - `NL26.12345` → `NL_LEGAL_CASE_NUMBER`
56
+ - `GEM-HLM-2026-2210` → `NL_LEGAL_CASE_NUMBER`
57
+ - `200.345.678/01 OK` → `NL_LEGAL_CASE_NUMBER`
58
+ - `76543210` after KvK context → `NL_KVK_NUMBER`
59
+ - Verified value-only behavior:
60
+ - context such as `Zaaknummer:` must remain readable;
61
+ - context such as `intern incidentnummer` must remain readable;
62
+ - context such as `Claimreferentie verzekeraar:` must remain readable;
63
+ - context such as `KvK-nummer vennootschap:` must remain readable.
64
+
65
+ Testing:
66
+
67
+ - GitHub Actions `Tests` passed.
68
+ - GitHub → Hugging Face sync passed.
69
+
70
+ Intentionally not changed:
71
+
72
+ - No UI changes.
73
+ - No MSI/local installer work.
74
+ - No new cloud dependency.
75
+
76
+ ---
77
+
78
+ ## v11.1 — Legal reference recognizer hardening
79
+
80
+ Status: completed and green in GitHub Actions.
81
+
82
+ Purpose:
83
+
84
+ - Harden recognition and review of Dutch legal/admin reference values.
85
+ - Move from isolated examples to category-level reference recognition.
86
+ - Preserve legal context while only selecting the sensitive value.
87
+
88
+ Files changed:
89
+
90
+ - `candidate_scanner.py`
91
+ - `test_cases/legal_regression_cases.py`
92
+ - `tests/test_candidate_scanner_regression.py`
93
+ - `tests/test_case_number_pattern_contract.py`
94
+
95
+ Main changes:
96
+
97
+ - Expanded the regression set with concrete Dutch legal/admin examples reported during testing.
98
+ - Added/validated cases for:
99
+ - court / case numbers;
100
+ - incident numbers;
101
+ - camera/video references;
102
+ - insurance claim references;
103
+ - repair numbers;
104
+ - administrative law case numbers;
105
+ - immigration case numbers;
106
+ - municipal case references;
107
+ - enterprise chamber / appellate style case numbers;
108
+ - KvK numbers in labelled context.
109
+ - Added a lightweight KvK fallback to the candidate scanner:
110
+ - `KvK-nummer vennootschap: 76543210` now yields value-only candidate `76543210` as `NL_KVK_NUMBER` when not already detected.
111
+ - Kept the candidate scanner as a review/audit layer:
112
+ - candidates remain unchecked by default in the UI;
113
+ - the user decides whether to include them.
114
+ - Updated the case-reference contract test to use the broader contextual value regex instead of only the strict formal court-number regex.
115
+
116
+ Important design decision:
117
+
118
+ - `GEM-HLM-2026-2210` is not a classic court-number format by itself.
119
+ - It becomes a legal case number because it appears near context such as `zaaknummer`.
120
+ - Therefore the test should reflect contextual recognition, not only raw pattern recognition.
121
+
122
+ Testing:
123
+
124
+ - GitHub Actions `Tests` passed after the contextual-value test correction.
125
+ - GitHub → Hugging Face sync passed.
126
+
127
+ Intentionally not changed:
128
+
129
+ - No broad blind masking of every uppercase/digit code.
130
+ - No automatic masking of weak candidates without context.
131
+ - No masking of article references, dates, amounts, postcodes or document navigation references as legal reference numbers.
132
+
133
+ ---
134
+
135
+ ## v10 — Regression test layer
136
+
137
+ Status: completed and green in GitHub Actions.
138
+
139
+ Purpose:
140
+
141
+ - Stop relying only on manual interface testing.
142
+ - Create a repeatable regression safety net before further recognizer changes.
143
+ - Protect context preservation and false-positive behavior.
144
+
145
+ Files added or changed:
146
+
147
+ - `test_cases/legal_regression_cases.py`
148
+ - `tests/test_candidate_scanner_regression.py`
149
+ - `tests/test_context_preservation_contract.py`
150
+ - `tests/test_case_number_pattern_contract.py`
151
+ - `.github/workflows/tests.yml`
152
+
153
+ Main changes:
154
+
155
+ - Added synthetic Dutch legal regression cases.
156
+ - Added candidate scanner tests for expected reference-like values.
157
+ - Added false-positive guards for:
158
+ - legal article references, e.g. `7:669 BW`;
159
+ - dates, e.g. `15-12-2025`;
160
+ - money/amount context, e.g. `EUR 1.250,00`.
161
+ - Added context preservation contract tests:
162
+ - `Slachtoffer` must stay readable;
163
+ - `minderjarige` must stay readable;
164
+ - `Verzoeker` must stay readable;
165
+ - role/context words must not be swallowed into the replacement span.
166
+ - Added a GitHub Actions workflow for Python regression tests.
167
+ - Fixed import path handling by setting `PYTHONPATH` to the repository root.
168
+ - Kept early tests lightweight to avoid unnecessary full Streamlit/Presidio/spaCy startup cost.
169
+
170
+ Testing:
171
+
172
+ - GitHub Actions `Tests` passed.
173
+ - GitHub → Hugging Face sync passed.
174
+
175
+ Intentionally not changed:
176
+
177
+ - No major recognizer changes in v10 itself.
178
+ - No UI redesign.
179
+
180
+ ---
181
+
182
+ ## v9.1 — UI polish and baseline stabilization
183
+
184
+ Status: completed and working in Hugging Face.
185
+
186
+ Purpose:
187
+
188
+ - Polish Dutch UI text after the v9 conversion.
189
+ - Keep the app stable before adding deeper regression infrastructure.
190
+
191
+ Files changed:
192
+
193
+ - `ui_texts_nl.py`
194
+
195
+ Main changes:
196
+
197
+ - Added `APP_VERSION = "v9.1"`.
198
+ - Corrected UI wording:
199
+ - `clientreferenties` → `cliëntreferenties`.
200
+ - Kept recognizer behavior unchanged.
201
+
202
+ Testing:
203
+
204
+ - GitHub → Hugging Face sync passed.
205
+ - User confirmed the app was working.
206
+
207
+ Intentionally not changed:
208
+
209
+ - No recognizer changes.
210
+ - No major UX redesign.
211
+
212
+ ---
213
+
214
+ ## v9 — Dutch Legal UI Layer
215
+
216
+ Status: completed and working in Hugging Face after startup hotfix.
217
+
218
+ Purpose:
219
+
220
+ - Move the app away from a technical “Presidio demo” feel.
221
+ - Present it as a Dutch legal document scrubber.
222
+ - Keep the underlying recognition engine, but make the user workflow more understandable for legal users.
223
+
224
+ Files added or changed:
225
+
226
+ - `ui_texts_nl.py`
227
+ - `display_labels_nl.py`
228
+ - `presidio_streamlit.py`
229
+ - `fix_streamlit_nested_expanders.py`
230
+ - `Dockerfile`
231
+
232
+ Main changes:
233
+
234
+ - Added Dutch product language:
235
+ - `Scrub Legal`
236
+ - `Lokale juridische documentcontrole`
237
+ - `Controlemodus`
238
+ - `Manier van vervangen`
239
+ - `Voeg document of tekst toe`
240
+ - `Controleer gevonden gegevens`
241
+ - `Mogelijke gemiste waarden`
242
+ - `Download opgeschoonde bestanden`
243
+ - Added a separate Dutch UI copy layer in `ui_texts_nl.py`.
244
+ - Added Dutch display labels for technical entity types in `display_labels_nl.py`.
245
+ - Reworked the main Streamlit app to make the workflow more legal-user oriented.
246
+ - Kept technical settings under advanced sections.
247
+ - Kept technical recognizer labels available, but made them less central in the interface.
248
+ - Restored/kept synthetic legal test example loading in the interface.
249
+ - Added a startup hotfix for Streamlit’s nested-expander limitation.
250
+
251
+ Important bug fixed:
252
+
253
+ - Streamlit does not allow an expander inside another expander.
254
+ - The first v9 implementation nested `Woordenlijsten` inside `Geavanceerde instellingen`.
255
+ - Added `fix_streamlit_nested_expanders.py` and updated the Docker startup command to patch this before Streamlit starts.
256
+
257
+ Testing:
258
+
259
+ - GitHub → Hugging Face sync passed.
260
+ - User confirmed app startup and interface were working.
261
+
262
+ Known limitation:
263
+
264
+ - Some Streamlit-native widget labels remain English, such as upload button internals (`Browse files`, `Drag and drop file here`). These come from Streamlit itself and are not fully controlled by normal UI strings.
265
+
266
+ ---
267
+
268
+ ## GitHub → Hugging Face automation
269
+
270
+ Status: completed and working.
271
+
272
+ Purpose:
273
+
274
+ - Replace manual download/upload file replacement workflow.
275
+ - Make GitHub the source of truth.
276
+ - Automatically sync `solidprivacy-nl/scrub` to the Hugging Face Space `solidprivacy/scrub`.
277
+
278
+ Files added or changed:
279
+
280
+ - `.github/workflows/sync-to-huggingface.yml`
281
+
282
+ Main changes:
283
+
284
+ - Added a GitHub Actions workflow for syncing to Hugging Face.
285
+ - Initial `huggingface/hub-sync` approach failed on SDK and API-rate issues.
286
+ - Replaced it with a simpler direct Git push workflow:
287
+ - checkout GitHub repo;
288
+ - add Hugging Face Space as remote;
289
+ - force-push `HEAD:main` to the Space.
290
+ - Added concurrency handling to avoid overlapping sync runs.
291
+
292
+ Problems encountered and fixed:
293
+
294
+ - Missing or insufficient Hugging Face token caused initial `Space not found` / authentication behavior.
295
+ - Space SDK mismatch was corrected from `streamlit` to `docker`.
296
+ - API `429 Too Many Requests` from `huggingface/hub-sync` was avoided by switching to direct Git push.
297
+
298
+ Testing:
299
+
300
+ - Sync workflow passed repeatedly after direct Git push implementation.
301
+
302
+ Security/ops note:
303
+
304
+ - The workflow expects a GitHub Actions secret named `HF_TOKEN`.
305
+ - This should be a Hugging Face token with write access to `solidprivacy/scrub`.
306
+
307
+ ---
308
+
309
+ ## Pre-GitHub incremental development phase
310
+
311
+ Status: superseded by GitHub workflow, but historically important.
312
+
313
+ Purpose:
314
+
315
+ - Improve the Hugging Face app through manual file replacement while the GitHub workflow was not yet connected.
316
+
317
+ Main themes:
318
+
319
+ - Dutch/EU recognizer direction.
320
+ - Legal-profession focus.
321
+ - Local/offline strategy for confidentiality.
322
+ - Recognition of Dutch legal references, case numbers and administrative identifiers.
323
+ - Candidate scanner / audit-layer idea.
324
+ - Synthetic legal examples for testing.
325
+ - Context preservation principle:
326
+ - do not mask role words such as `slachtoffer`, `minderjarige`, `verzoeker`, `verweerder`;
327
+ - mask the person/value, not the legal meaning of the sentence.
328
+
329
+ Important design conclusions:
330
+
331
+ - A local deterministic scrubber is a better MVP path than relying on cloud LLMs.
332
+ - Local LLMs may be useful later, but they are not the best first layer for a fast legal scrubber.
333
+ - The MVP should combine:
334
+ - deterministic recognizers;
335
+ - Dutch legal/admin taxonomy;
336
+ - review table;
337
+ - candidate scanner;
338
+ - regression tests;
339
+ - eventually local packaging.
340
+
341
+ ---
342
+
343
+ ## Planned next phase — v12 Review UX
344
+
345
+ Status: planned, not yet implemented.
346
+
347
+ Goal:
348
+
349
+ - Improve the review experience after recognizer and test foundations are stable.
350
+
351
+ Planned scope:
352
+
353
+ - Clear row status:
354
+ - automatically replaced;
355
+ - needs review;
356
+ - manually added;
357
+ - remembered replacement.
358
+ - Better replacement table layout:
359
+ - compact default columns;
360
+ - less technical noise;
361
+ - clearer Dutch labels.
362
+ - Filters:
363
+ - show only “controle nodig”;
364
+ - show only legal references;
365
+ - show only names/addresses;
366
+ - show only low-confidence items.
367
+ - Better candidate warnings:
368
+ - clearly explain that candidates are not automatically replaced unless selected.
369
+ - Hide technical entity types and raw scores by default; keep them available in an advanced/technical view.
370
+
371
+ Non-goals for v12:
372
+
373
+ - No MSI/local desktop packaging yet.
374
+ - No LLM integration.
375
+ - No broad new recognizer families unless required to support the review UX.
376
+
377
+ ---
378
+
379
+ ## Planned later phase — v13 and beyond
380
+
381
+ Possible directions:
382
+
383
+ - Further recognizer expansion by legal domain:
384
+ - family law;
385
+ - criminal law;
386
+ - labour law;
387
+ - immigration law;
388
+ - administrative law;
389
+ - housing/real estate;
390
+ - insurance / personal injury.
391
+ - Local packaging research:
392
+ - Windows desktop app;
393
+ - local-only processing;
394
+ - MSI installer path;
395
+ - model/runtime size constraints.
396
+ - More advanced DOCX/PDF preservation.
397
+ - Better synthetic long-form legal test documents.