File size: 25,529 Bytes
1f5e008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221b249
 
 
 
b0bf8ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d653643
 
b0bf8ae
d653643
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b0bf8ae
d653643
 
 
 
 
 
 
 
 
 
 
 
 
 
b0bf8ae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8b16d7e
221b249
bf2d151
221b249
 
 
8b16d7e
 
 
 
221b249
 
 
 
 
8b16d7e
 
221b249
 
bf2d151
221b249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8b16d7e
 
 
bf2d151
221b249
bf2d151
221b249
 
8b16d7e
 
bf2d151
 
 
 
221b249
 
 
bf2d151
 
221b249
8b16d7e
 
 
221b249
 
 
 
 
 
 
8b16d7e
221b249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8b16d7e
221b249
 
 
 
 
 
 
 
 
 
 
 
8b16d7e
221b249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1f5e008
 
 
22c81f5
b8ac0f9
221b249
b8ac0f9
 
 
22c81f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8b16d7e
22c81f5
221b249
22c81f5
 
 
 
 
 
 
 
 
 
221b249
22c81f5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0c61b78
 
 
 
 
 
 
 
 
 
 
 
 
8b16d7e
22c81f5
0c61b78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22c81f5
 
0c61b78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b8ac0f9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22c81f5
b8ac0f9
 
 
 
0c61b78
 
 
b8ac0f9
 
 
 
 
 
 
 
 
 
1f5e008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
221b249
 
1f5e008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22c81f5
 
 
1f5e008
 
 
 
221b249
 
1f5e008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22c81f5
 
1f5e008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22c81f5
 
1f5e008
22c81f5
1f5e008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22c81f5
1f5e008
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22c81f5
1f5e008
 
 
 
 
22c81f5
1f5e008
 
 
 
 
 
 
22c81f5
 
1f5e008
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# Changelog — SolidPrivacy Scrub

This changelog records meaningful product, architecture, workflow and recognizer changes for the Scrub legal document scrubber.

Conventions:

- Keep this file explicit and human-readable.
- Group changes by project phase / version.
- Record what changed, why it changed, and what is intentionally not changed.
- Do not use this as a substitute for tests; every recognizer hardening step should also add or update regression tests.

---

## Current development rule

From v10 onward, recognizer work follows this order:

1. Add or update synthetic regression cases.
2. Add or update tests.
3. Change recognizer / scanner logic.
4. Verify GitHub Actions tests are green.
5. Let GitHub sync to Hugging Face automatically.
6. Test the app in Hugging Face.

For UI/UX-only work, prefer pure helper modules and tests before touching Streamlit UI flow.

---

## WP Status Reconciliation — WP3/WP4 verification evidence

Status: reconciliation completed; GitHub Actions and Hugging Face sync could not be independently confirmed through the connector.

Purpose:

- Verify and reconcile status for:
  - v12.6 export sanity commits;
  - v13.0 Scrub Key commits, especially `d65364373e4d3612044d8688ac17e11de81c07e5`.
- Update project control files without changing code or UI behavior.

Verification attempted:

- WP3/v12.6 commits checked:
  - `5342e0eef663817036e91f823b4389b338b9223c` — Add v12.6 export sanity helper.
  - `704ae03788702ce33263343743a69f8139f16319` — Add v12.6 export sanity tests.
  - `869e3804edf04e0cbdf7ab69b034e7bc707de8c3` — Update workpackage status for export sanity helper.
  - `4d721e3aed3bf28cfdaeb096c0e9cd227885f1a6` — Add v12.6 export sanity handover.
- WP4/v13.0 target commit checked:
  - `d65364373e4d3612044d8688ac17e11de81c07e5` — Record v13.0 Scrub Key model in changelog.

Connector findings:

- GitHub combined status returned `statuses: []` for checked WP3 commits.
- Commit workflow-run lookup returned `workflow_runs: []` for checked WP3 commits.
- GitHub combined status returned `statuses: []` for `d65364373e4d3612044d8688ac17e11de81c07e5`.
- Commit workflow-run lookup returned `workflow_runs: []` for `d65364373e4d3612044d8688ac17e11de81c07e5`.
- Because of this, this worker did not mark Actions/sync as green.

Recorded repo evidence:

- WP3 handover records local targeted validation:
  - `PYTHONPATH=. pytest -q tests/test_export_sanity.py tests/test_review_summary.py` → 12 passed.
- WP4 changelog records local targeted validation:
  - `PYTHONPATH=. pytest -q tests/test_scrub_key.py` → 6 passed.

Files changed:

- `WORKPACKAGES.md`
- `CHANGELOG.md`
- `handover/workpackages/20260607_1425_wp3_wp4_status_reconciliation.md`

Intentionally not changed:

- No code files.
- No UI files.
- No tests.
- No export semantics.
- No Hugging Face app behavior.

Next step:

- Coordinator should verify the latest GitHub Actions `Tests` and GitHub to Hugging Face sync in the GitHub UI, because the connector did not expose workflow-run evidence for these commits.

---

## v13.0 — Scrub Key specification and pure model

Status: implemented; local targeted tests passed; GitHub Actions and Hugging Face sync not independently confirmed by this worker.

Purpose:

- Prepare the v13 Scrub Key / Reinsert phase without touching the active review UI.
- Define the local mapping file concept for future reversible workflows.
- Add a pure Python model with validation and JSON roundtrip support.
- Make pseudonymization safety boundaries explicit before UI/export work starts.

Files added or changed:

- `SCRUB_KEY_SPEC.md`
- `scrub_key.py`
- `tests/test_scrub_key.py`
- `WORKPACKAGES.md`
- `CHANGELOG.md`
- `handover/workpackages/20260607_1342_v13_0_scrub_key_spec_model.md`

Main changes:

- Added a Scrub Key specification for the future workflow:
  - `Scrub → Review → Scrub Key → AI → Reinsert → Export → Audit`.
- Defined required mapping fields:
  - original value;
  - placeholder;
  - entity type;
  - user-facing type label;
  - source;
  - review status;
  - include state;
  - timestamp;
  - optional document/project/dossier label.
- Added required safety language explaining that a Scrub Key makes scrubbed text reversible.
- Explicitly classified the Scrub Key model as pseudonymization, not full anonymization.
- Added local/protected key handling guidance and external-AI sharing warning.
- Added a deterministic pure helper model:
  - `build_scrub_key(rows, document_label=None)`;
  - `scrub_key_to_json(scrub_key)`;
  - `scrub_key_from_json(text)`;
  - `validate_scrub_key(scrub_key)`.
- Set the v13.0 excluded-row policy to `omitted`, so unchecked rows are not written into the key.
- Kept timestamp handling deterministic: the model does not create timestamps itself; validation catches missing timestamps.

Testing:

- Added `tests/test_scrub_key.py`.
- Local targeted validation passed: `PYTHONPATH=. pytest -q tests/test_scrub_key.py` → 6 passed.
- Tests cover valid key creation, excluded-row omission, required fields, JSON roundtrip, validation errors, and synthetic Dutch legal examples only.
- Connector check attempted for commit `d65364373e4d3612044d8688ac17e11de81c07e5`, but no check/status evidence was exposed.

Intentionally not changed:

- No direct edit to `presidio_streamlit.py`.
- No direct edit to `fix_streamlit_nested_expanders.py`.
- No export/download buttons.
- No reinsert UI.
- No cloud processing.
- No secret storage.
- No real personal data in tests or examples.
- No change to active review UI or export semantics.

---

## v12.6 — Export sanity checks helper and tests

Status: helper implemented; local targeted tests passed; GitHub Actions and Hugging Face sync not independently confirmed by this worker.

Purpose:

- Prepare advisory export sanity-check logic before UI integration.
- Warn users when review risk remains.
- Preserve existing export semantics and download behavior.

Files added or changed:

- `export_sanity.py`
- `tests/test_export_sanity.py`
- `WORKPACKAGES.md`
- `handover/workpackages/20260607_1405_v12_6_export_sanity_helper.md`

Main changes:

- Added pure helper logic for advisory export readiness checks.
- Added Dutch user-facing warning text for:
  - unchecked `Controle nodig` rows;
  - candidate rows not included;
  - no replacements selected;
  - user review still required;
  - export not guaranteeing full anonymization.
- Added readiness labels:
  - `Geen vervangregels gevonden — controleer handmatig`;
  - `Geen vervangingen geselecteerd`;
  - `Controle nodig vóór export`;
  - `Klaar voor export na gebruikerscontrole`.
- Explicitly preserved helper flags:
  - `blocks_export = False`;
  - `changes_export_semantics = False`.
- Reused review-summary normalization logic where helpful.

Testing:

- Added `tests/test_export_sanity.py`.
- Local targeted validation passed in the WP3 handover:
  - `PYTHONPATH=. pytest -q tests/test_export_sanity.py tests/test_review_summary.py` → 12 passed.
- Connector check attempted for WP3 commits `5342e0eef663817036e91f823b4389b338b9223c`, `704ae03788702ce33263343743a69f8139f16319`, `869e3804edf04e0cbdf7ab69b034e7bc707de8c3`, and `4d721e3aed3bf28cfdaeb096c0e9cd227885f1a6`, but no check/status evidence was exposed.

Intentionally not changed:

- No direct edit to `presidio_streamlit.py`.
- No direct edit to `fix_streamlit_nested_expanders.py`.
- No change to `review_summary.py`.
- No export/download blocking.
- No change to which rows are included in export.
- No Scrub Key or reinsert implementation.
- No LLM/cloud feature.

---

## v12.5 — Final review summary

Status: completed and app verified.

Purpose:

- Show final export readiness before downloads.
- Make export scope clear before the user downloads files.
- Warn when candidate rows still need attention.
- Preserve existing replacement and export semantics.

Files added or changed:

- `review_summary.py`
- `tests/test_review_summary.py`
- `tests/test_review_summary_ui_patch.py`
- `fix_streamlit_nested_expanders.py`
- `WORKPACKAGES.md`
- `CHANGELOG.md`
- `handover/workpackages/20260607_1345_v12_5_review_summary_closeout.md`

Main changes:

- Added a pure helper that accepts review rows as dictionaries or DataFrame-like records.
- Added summary counts for:
  - total rows;
  - automatically detected rows;
  - rows needing review;
  - manually added rows;
  - remembered replacement rows;
  - checked rows included in export;
  - unchecked rows excluded from export;
  - open unchecked candidate rows.
- Added conservative include-flag parsing for boolean, numeric and Dutch/string values.
- Added status inference from stable status values, Dutch status labels, source fields and manual/remembered entity markers.
- Added Dutch readiness labels and markdown summary lines.
- Integrated the summary into the existing startup UI patch so the app shows `Eindcontrole vóór download` immediately above the download section.
- Kept the summary advisory only: it displays counts and readiness labels but does not block or alter downloads.
- Formally closed v12.5 after coordinator/user verification.

Testing and verification:

- Added unit tests for `review_summary.py`.
- Added a UI patch contract test to verify that the summary helper is imported and displayed before downloads.
- Local targeted validation before UI integration passed: `PYTHONPATH=. pytest -q tests/test_review_summary.py` → 5 passed.
- Coordinator reported GitHub Actions tests green for the v12.5 review summary line.
- Coordinator reported GitHub to Hugging Face sync green for the v12.5 review summary line.
- Hugging Face app was visually verified and showed `Eindcontrole vóór download` before the download section.
- Downloads were reported as still working after verification: text, CSV, DOCX and PDF.

Intentionally not changed:

- No direct edit to `presidio_streamlit.py` during closeout.
- No direct edit to `fix_streamlit_nested_expanders.py` during closeout.
- No recognizer changes.
- No entity-type expansion.
- No export/download blocking.
- No change to which rows are included in export.
- No Scrub Key or reinsert implementation.
- No LLM/cloud feature.

---

## v12.4 — Review guidance text

Status: implemented; GitHub Actions and Hugging Face sync confirmed green by coordinator; app visually confirmed by user.

Purpose:

- Make the review workflow self-explanatory for non-technical legal users.
- Explain that only checked rows are included in export.
- Explain that `Controle nodig` rows require manual review.
- Explain that the focus filter is a viewing aid, not the export scope.
- Explain that technical details are mainly for audit/debugging.
- Add AI-use guidance: scrub first, then use AI.

Files added or changed:

- `review_guidance.py`
- `tests/test_review_guidance.py`
- `fix_streamlit_nested_expanders.py`
- `WORKPACKAGES.md`
- `CHANGELOG.md`

Main changes:

- Added short Dutch review guidance strings.
- Added markdown helper for guidance bullets.
- Patched the review flow to show guidance near the replacement table and export step.
- Kept the guidance advisory only; it does not alter replacement selection or export behavior.

Testing:

- Added unit tests for guidance text coverage.
- User visually confirmed the guidance block appeared correctly in Hugging Face.
- Coordinator confirmed latest Actions and Hugging Face sync green for the helper/governance commits through `fffd27b`.

Intentionally not changed:

- No recognizer changes.
- No export semantics change.
- No desktop/MSI work.
- No LLM/cloud feature.

---

## Project governance setup

Status: implemented; Actions/sync confirmed green by coordinator through latest governance/helper handover commits.

Purpose:

- Make GitHub the operational source of truth for SolidPrivacy Scrub workpackages.
- Establish a central project prompt, roadmap, workpackage plan and handover convention.
- Prepare continuation across fresh chats/workers.

Files added or changed:

- `PROJECT_PROMPT.md`
- `PROJECT_PROMPT_SHORT.md`
- `ROADMAP.md`
- `WORKPACKAGES.md`
- `handover/workpackages/20260607_1057_project_prompt_governance_handover.md`

Main changes:

- Added a full worker prompt with repository boundaries, source-of-truth rules, testing/sync rules and handover discipline.
- Added a short project prompt for ChatGPT Project Instructions.
- Added the central roadmap and executable workpackage plan.
- Established `handover/workpackages/` as the coordinator-readable handover directory.

---

## v12.3 — Review table simplification

Status: completed and user-confirmed after pandas Index bugfix.

Purpose:

- Reduce visual noise in the replacement table.
- Keep the main review table focused on the columns legal users actually need to edit.
- Preserve technical/audit information in a separate details view.
- Keep recognizer and export semantics unchanged.

Files added or changed:

- `review_table_config.py`
- `tests/test_review_table_config.py`
- `fix_streamlit_nested_expanders.py`
- `CHANGELOG.md`

Main changes:

- Added a central table configuration module.
- Main editable review table now focuses on:
  - `Meenemen`
  - `Onthouden`
  - `Status`
  - `Gevonden tekst`
  - `Vervangen door`
  - `Type gegeven`
  - `Zekerheid`
- Technical and audit-oriented columns are moved out of the primary editing view.
- Added a separate `Technische details bij de vervangtabel` expander.
- Fixed pandas Index truth-value handling by explicitly converting available columns to list/set.

Important design decision:

- The full data remains present in the underlying dataframe.
- The main table is simplified visually, but exports and reports still use the available row data.
- The technical details remain accessible for debugging, auditability and future tuning.

Testing:

- Added unit tests for `review_table_config.py`.
- User confirmed the simplified review table and technical-details flow worked after the bugfix.

Intentionally not changed:

- No recognizer changes.
- No entity-type expansion.
- No export semantics change.
- No MSI/local installer work.
- No LLM/cloud feature.

---

## v12.2 — Review focus filters

Status: completed and green in GitHub Actions.

Purpose:

- Add practical focus filters on top of the v12.1 review-status model.
- Help the legal reviewer quickly inspect only the rows that matter for a specific task.
- Keep export semantics safe: the filter is an overview/focus tool, not the authoritative edited replacement table.

Files added or changed:

- `review_filters.py`
- `tests/test_review_filters.py`
- `fix_streamlit_nested_expanders.py`
- `CHANGELOG.md`

Main changes:

- Added pure filter helpers with Dutch filter labels.
- Added filter groups for legal/admin reference entity types, names and address-like data.
- Added low-confidence filtering based on either Dutch confidence label `Laag` or numeric score below `0.60`.
- Added tests for all filter modes.
- Extended the Streamlit startup patch so the review step gets a `Focusfilter voor controle` selectbox.
- When a focus filter is active, the app shows a read-only filtered overview above the full editable replacement table.

Important design decision:

- v12.2 does **not** filter the editable table itself.
- The full replacement table remains the source of truth for exports.
- This prevents hidden rows from being accidentally dropped from the final export.
- The focus filter is deliberately a safe review aid, not an edit-scope limiter.

Testing:

- Added unit tests for `review_filters.py`.
- GitHub Actions `Tests` passed.
- GitHub → Hugging Face sync passed.

Intentionally not changed:

- No recognizer changes.
- No entity-type expansion.
- No export semantics change.
- No MSI/local installer work.
- No LLM/cloud feature.

---

## v12.1 — Review table status model

Status: completed and green in GitHub Actions; user confirmed the Status column appears in Hugging Face.

Purpose:

- Start the v12 Review UX phase with a simple, explicit review-status model.
- Make it clearer to a legal user which rows are already applied, which need review, which are manual, and which come from remembered replacements.
- Keep recognizer logic unchanged.

Files added or changed:

- `review_status.py`
- `tests/test_review_status.py`
- `fix_streamlit_nested_expanders.py`
- `CHANGELOG.md`

Main changes:

- Added a pure review-status model with stable internal values:
  - `auto_detected`
  - `needs_review`
  - `manual`
  - `remembered`
- Added Dutch user-facing labels:
  - `Automatisch vervangen`
  - `Controle nodig`
  - `Handmatig toegevoegd`
  - `Onthouden vervanging`
- Added sorting order so rows needing review appear before automatically applied rows.
- Added tests for source-to-status mapping and ordering.
- Extended the existing Streamlit startup patch so the replacement table gets a visible `Status` column, internal status fields and a compact status summary above the editor.

Testing:

- Added unit tests for `review_status.py`.
- GitHub Actions `Tests` passed.
- GitHub → Hugging Face sync passed.
- User confirmed the Status column appeared correctly in the Hugging Face app.

Intentionally not changed:

- No recognizer changes.
- No new entity types.
- No MSI/local installer work.
- No LLM/cloud feature.

---

## v11.2 — Dutch recognizer integration tests

Status: completed and green in GitHub Actions.

Purpose:

- Prove that the real Dutch recognizer layer works, not only the candidate scanner / audit layer.
- Test recognizer output at value/span level.
- Confirm that context labels remain readable and are not swallowed into the sensitive span.

Files added or changed:

- `.github/workflows/tests.yml`
- `tests/test_dutch_recognizers_integration.py`

Main changes:

- Added lightweight recognizer integration tests using `get_dutch_recognizers()` directly.
- Verified that v11.1 legal reference values are detected by the actual recognizers.
- Verified expected entity types for representative court/case numbers, incident numbers, camera/video references, insurance claim references, repair numbers, immigration numbers, municipal references and KvK numbers.
- Verified value-only behavior so context labels remain readable.

Testing:

- GitHub Actions `Tests` passed.
- GitHub → Hugging Face sync passed.

Intentionally not changed:

- No UI changes.
- No MSI/local installer work.
- No new cloud dependency.

---

## v11.1 — Legal reference recognizer hardening

Status: completed and green in GitHub Actions.

Purpose:

- Harden recognition and review of Dutch legal/admin reference values.
- Move from isolated examples to category-level reference recognition.
- Preserve legal context while only selecting the sensitive value.

Files changed:

- `candidate_scanner.py`
- `test_cases/legal_regression_cases.py`
- `tests/test_candidate_scanner_regression.py`
- `tests/test_case_number_pattern_contract.py`

Main changes:

- Expanded the regression set with concrete Dutch legal/admin examples reported during testing.
- Added/validated cases for court/case numbers, incident numbers, camera/video references, insurance claim references, repair numbers, immigration numbers, municipal references and KvK numbers in labelled context.
- Added a lightweight KvK fallback to the candidate scanner.
- Kept the candidate scanner as a review/audit layer with candidates unchecked by default.
- Updated the case-reference contract test to use the broader contextual value regex instead of only the strict formal court-number regex.

Important design decision:

- Context can make a generic-looking reference legally relevant.
- Tests reflect contextual recognition, not only raw pattern recognition.

Testing:

- GitHub Actions `Tests` passed after the contextual-value test correction.
- GitHub → Hugging Face sync passed.

Intentionally not changed:

- No broad blind masking of every uppercase/digit code.
- No automatic masking of weak candidates without context.
- No masking of article references, dates, amounts, postcodes or document navigation references as legal reference numbers.

---

## v10 — Regression test layer

Status: completed and green in GitHub Actions.

Purpose:

- Stop relying only on manual interface testing.
- Create a repeatable regression safety net before further recognizer changes.
- Protect context preservation and false-positive behavior.

Files added or changed:

- `test_cases/legal_regression_cases.py`
- `tests/test_candidate_scanner_regression.py`
- `tests/test_context_preservation_contract.py`
- `tests/test_case_number_pattern_contract.py`
- `.github/workflows/tests.yml`

Main changes:

- Added synthetic Dutch legal regression cases.
- Added candidate scanner tests for expected reference-like values.
- Added false-positive guards for legal article references, dates and money/amount context.
- Added context preservation contract tests for words such as `Slachtoffer`, `minderjarige` and `Verzoeker`.
- Added a GitHub Actions workflow for Python regression tests.
- Fixed import path handling by setting `PYTHONPATH` to the repository root.
- Kept early tests lightweight to avoid unnecessary full Streamlit/Presidio/spaCy startup cost.

Testing:

- GitHub Actions `Tests` passed.
- GitHub → Hugging Face sync passed.

Intentionally not changed:

- No major recognizer changes in v10 itself.
- No UI redesign.

---

## v9.1 — UI polish and baseline stabilization

Status: completed and working in Hugging Face.

Purpose:

- Polish Dutch UI text after the v9 conversion.
- Keep the app stable before adding deeper regression infrastructure.

Files changed:

- `ui_texts_nl.py`

Main changes:

- Added `APP_VERSION = "v9.1"`.
- Corrected UI wording:
  - `clientreferenties` → `cliëntreferenties`.
- Kept recognizer behavior unchanged.

Testing:

- GitHub → Hugging Face sync passed.
- User confirmed the app was working.

Intentionally not changed:

- No recognizer changes.
- No major UX redesign.

---

## v9 — Dutch Legal UI Layer

Status: completed and working in Hugging Face after startup hotfix.

Purpose:

- Move the app away from a technical “Presidio demo” feel.
- Present it as a Dutch legal document scrubber.
- Keep the underlying recognition engine, but make the user workflow more understandable for legal users.

Files added or changed:

- `ui_texts_nl.py`
- `display_labels_nl.py`
- `presidio_streamlit.py`
- `fix_streamlit_nested_expanders.py`
- `Dockerfile`

Main changes:

- Added Dutch product language and workflow language such as `Scrub Legal`, `Lokale juridische documentcontrole`, `Controlemodus`, `Voeg document of tekst toe`, `Controleer gevonden gegevens`, `Mogelijke gemiste waarden` and `Download opgeschoonde bestanden`.
- Added a separate Dutch UI copy layer and Dutch display labels for technical entity types.
- Reworked the main Streamlit app to make the workflow more legal-user oriented.
- Restored/kept synthetic legal test example loading.
- Added a startup hotfix for Streamlit’s nested-expander limitation.

Known limitation:

- 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.

---

## GitHub → Hugging Face automation

Status: completed and working.

Purpose:

- Replace manual download/upload file replacement workflow.
- Make GitHub the source of truth.
- Automatically sync `solidprivacy-nl/scrub` to the Hugging Face Space `solidprivacy/scrub`.

Files added or changed:

- `.github/workflows/sync-to-huggingface.yml`

Main changes:

- Added a GitHub Actions workflow for syncing to Hugging Face.
- Initial `huggingface/hub-sync` approach failed on SDK and API-rate issues.
- Replaced it with a simpler direct Git push workflow.
- Added concurrency handling to avoid overlapping sync runs.

Security/ops note:

- The workflow expects a GitHub Actions secret named `HF_TOKEN`.
- This should be a Hugging Face token with write access to `solidprivacy/scrub`.

---

## Pre-GitHub incremental development phase

Status: superseded by GitHub workflow, but historically important.

Purpose:

- Improve the Hugging Face app through manual file replacement while the GitHub workflow was not yet connected.

Main themes:

- Dutch/EU recognizer direction.
- Legal-profession focus.
- Local/offline strategy for confidentiality.
- Recognition of Dutch legal references, case numbers and administrative identifiers.
- Candidate scanner / audit-layer idea.
- Synthetic legal examples for testing.
- Context preservation principle: do not mask role words such as `slachtoffer`, `minderjarige`, `verzoeker`, `verweerder`; mask the person/value, not the legal meaning of the sentence.

Important design conclusions:

- A local deterministic scrubber is a better MVP path than relying on cloud LLMs.
- Local LLMs may be useful later, but they are not the best first layer for a fast legal scrubber.
- The MVP should combine deterministic recognizers, Dutch legal/admin taxonomy, review table, candidate scanner, regression tests and eventually local packaging.

---

## Planned later phase — v13 and beyond

Possible directions:

- Further recognizer expansion by legal domain: family law, criminal law, labour law, immigration law, administrative law, housing/real estate and insurance/personal injury.
- Local packaging research: Windows desktop app, local-only processing, MSI installer path and model/runtime size constraints.
- More advanced DOCX/PDF preservation.
- Better synthetic long-form legal test documents.