solidprivacy-nl commited on
Commit
84f5312
·
1 Parent(s): 7725182

Record deterministic reinsert UI implementation

Browse files
Files changed (1) hide show
  1. CHANGELOG.md +77 -140
CHANGELOG.md CHANGED
@@ -26,9 +26,80 @@ For UI/UX-only work, prefer pure helper modules and tests before touching Stream
26
 
27
  ---
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  ## v13.3 — Deterministic reinsert UI planning
30
 
31
- Status: implemented; reinsert UI implementation can start as a separate sequential workpackage.
32
 
33
  Purpose:
34
 
@@ -79,17 +150,12 @@ Required audit summary specified:
79
  - no-AI status;
80
  - no-cloud status.
81
 
82
- Future UI test requirements specified:
83
-
84
- - Add a future patch test file such as `tests/test_scrub_key_reinsert_ui_patch.py`.
85
- - Guard helper import, UI labels, warning text, audit fields, button-gated helper call, no AI/cloud behavior, no `st.stop()`, existing Scrub Key export, existing import/reload UI, and existing export/download markers.
86
-
87
  Testing and validation:
88
 
89
  - Tests: not applicable; planning/specification-only workpackage.
90
- - App verification: not applicable; no UI behavior changed.
91
 
92
- Intentionally not changed:
93
 
94
  - No UI code changed.
95
  - No direct edit to `fix_streamlit_nested_expanders.py`.
@@ -105,7 +171,7 @@ Intentionally not changed:
105
 
106
  Outcome:
107
 
108
- - v13.3 deterministic reinsert UI is planned and ready for a separate sequential implementation workpackage.
109
 
110
  ---
111
 
@@ -120,12 +186,6 @@ Purpose:
120
  - Confirm that the helper remains pure, local and deterministic.
121
  - Preserve the boundary that no UI, AI-output flow, cloud processing or export/download behavior change was added.
122
 
123
- Files added or changed in this reconciliation:
124
-
125
- - `WORKPACKAGES.md`
126
- - `CHANGELOG.md`
127
- - `handover/workpackages/20260607_1845_v13_3_reinsert_helper_verification_reconciliation.md`
128
-
129
  Verification evidence:
130
 
131
  - Tests #106 green — commit `5854dbf`.
@@ -143,104 +203,12 @@ Validation status:
143
  - Hugging Face sync: green based on coordinator evidence.
144
  - App verification: not applicable, helper-only package.
145
 
146
- Intentionally not changed in this reconciliation:
147
-
148
- - No code files changed.
149
- - No tests changed.
150
- - No UI added.
151
- - No direct edit to `scrub_key_reinsert.py`.
152
- - No direct edit to `tests/test_scrub_key_reinsert.py`.
153
- - No direct edit to `presidio_streamlit.py`.
154
- - No direct edit to `fix_streamlit_nested_expanders.py`.
155
- - No edit to `scrub_key.py`.
156
- - No edit to `scrub_key_import.py`.
157
- - No edit to `tests/*`.
158
- - No AI calls.
159
- - No cloud processing.
160
- - No automatic document rehydration.
161
- - No change to TXT, CSV, DOCX or PDF export behavior.
162
- - No change to Scrub Key export behavior.
163
- - No change to Scrub Key import UI behavior.
164
- - No secrets, tokens or real personal data.
165
-
166
  Outcome:
167
 
168
  - v13.3 deterministic reinsert helper is completed and formally closed.
169
 
170
  ---
171
 
172
- ## v13.3 — Deterministic reinsert helper closeout
173
-
174
- Status: completed and formally closed after Actions/sync verification.
175
-
176
- Purpose:
177
-
178
- - Verify and close out the v13.3 deterministic reinsert helper workpackage.
179
- - Record that the helper remains pure, local and deterministic.
180
- - Preserve the boundary that no UI, AI-output flow, cloud processing or export/download behavior change was added.
181
-
182
- Files added or changed in the full v13.3 helper line:
183
-
184
- - `scrub_key_reinsert.py`
185
- - `tests/test_scrub_key_reinsert.py`
186
- - `WORKPACKAGES.md`
187
- - `CHANGELOG.md`
188
- - `handover/workpackages/20260607_1745_v13_3_reinsert_helper.md`
189
- - `handover/workpackages/20260607_1815_v13_3_reinsert_helper.md`
190
- - `handover/workpackages/20260607_1830_v13_3_reinsert_helper_closeout.md`
191
- - `handover/workpackages/20260607_1845_v13_3_reinsert_helper_verification_reconciliation.md`
192
-
193
- Main changes:
194
-
195
- - Added `detect_placeholders(text)` for conservative placeholder-token detection.
196
- - Added `build_reinsert_mapping(scrub_key)` to build a deterministic placeholder-to-original mapping from included Scrub Key items.
197
- - Added `reinsert_from_scrub_key(text, scrub_key)` to return reinserted text and an audit summary.
198
- - Reused existing `validate_scrub_key(...)` validation.
199
- - Invalid Scrub Keys return validation issues and do not modify the input text.
200
- - Duplicate placeholder entries are detected and excluded from reinsertion to avoid ambiguity.
201
- - Excluded Scrub Key items are ignored even if malformed/imported data contains them.
202
- - Audit output includes item count, active item count, excluded item count, replacement count, placeholders not found, unknown placeholders, duplicate placeholders and validation issues.
203
- - Audit output explicitly records local/no-AI/no-cloud behavior through `local_only=True`, `ai_processing=False` and `cloud_processing=False`.
204
-
205
- Testing and verification:
206
-
207
- - Added `tests/test_scrub_key_reinsert.py`.
208
- - Tests cover valid reinsert, multiple placeholders, repeated placeholders, missing placeholders, unknown placeholders, invalid Scrub Key validation issues, duplicate placeholder detection, excluded rows not being reinserted, synthetic values only, input immutability and no-AI/no-cloud flags.
209
- - Local targeted validation recorded by the implementation worker on the available/reconstructed subset:
210
- - `PYTHONPATH=. pytest -q tests/test_scrub_key.py tests/test_scrub_key_import.py tests/test_scrub_key_reinsert.py` → 25 passed.
211
- - Coordinator verification evidence confirms Actions and sync green:
212
- - Tests #106 green — commit `5854dbf`.
213
- - Sync to Hugging Face Space #120 green — commit `5854dbf`.
214
- - Tests #107 green — commit `43ecad4`.
215
- - Sync to Hugging Face Space #121 green — commit `43ecad4`.
216
- - Tests #108 green — commit `6e4ec9b`.
217
- - Sync to Hugging Face Space #122 green — commit `6e4ec9b`.
218
- - Tests #109 green — commit `eaf036a`.
219
- - Sync to Hugging Face Space #123 green — commit `eaf036a`.
220
- - App verification is not applicable because this is a helper-only package.
221
-
222
- Intentionally not changed:
223
-
224
- - No code files changed in WP7B-FINAL reconciliation.
225
- - No UI added.
226
- - No direct edit to `presidio_streamlit.py`.
227
- - No direct edit to `fix_streamlit_nested_expanders.py`.
228
- - No edit to `scrub_key.py`.
229
- - No edit to `scrub_key_import.py`.
230
- - No AI calls.
231
- - No cloud processing.
232
- - No automatic document rehydration.
233
- - No change to TXT, CSV, DOCX or PDF export behavior.
234
- - No change to Scrub Key export behavior.
235
- - No change to Scrub Key import UI behavior.
236
- - No secrets, tokens or real personal data.
237
-
238
- Outcome:
239
-
240
- - v13.3 deterministic reinsert helper is implemented, verified and formally closed.
241
-
242
- ---
243
-
244
  ## v13.2 — Scrub Key import/reload UI app verification closeout
245
 
246
  Status: completed, app-verified and closed.
@@ -251,12 +219,6 @@ Purpose:
251
  - Record that the implemented import/reload flow works in the Hugging Face app.
252
  - Preserve the boundary that this phase is import/reload only and does not add AI-output reinsert.
253
 
254
- Files added or changed:
255
-
256
- - `WORKPACKAGES.md`
257
- - `CHANGELOG.md`
258
- - `handover/workpackages/20260607_1730_v13_2_scrub_key_import_ui_app_closeout.md`
259
-
260
  Technical evidence already recorded:
261
 
262
  - Tests #89 green — commit `83353e4`.
@@ -277,31 +239,6 @@ App verification:
277
  - Existing `Download Scrub Key (.json)` remains visible.
278
  - Existing TXT, CSV, DOCX and PDF downloads remain available.
279
 
280
- Closeout notes:
281
-
282
- - GitHub Actions tests were green based on coordinator evidence.
283
- - GitHub to Hugging Face sync was green based on coordinator evidence.
284
- - Import/reload remains local and uses the existing helper logic.
285
- - The key remains pseudonymization/reversible and must be protected.
286
- - No AI-output reinsert behavior was added.
287
- - No automatic document rehydration was added.
288
- - No export/download behavior was intentionally changed.
289
-
290
- Intentionally not changed in this app-verification closeout:
291
-
292
- - No code files changed.
293
- - No tests changed.
294
- - No direct edit to `fix_streamlit_nested_expanders.py`.
295
- - No direct edit to `presidio_streamlit.py`.
296
- - No edit to `scrub_key.py`.
297
- - No edit to `scrub_key_import.py`.
298
- - No edit to `tests/*`.
299
- - No AI-output reinsert behavior.
300
- - No automatic document rehydration.
301
- - No change to TXT, CSV, DOCX or PDF export/download behavior.
302
- - No cloud processing.
303
- - No secrets, tokens or real personal data.
304
-
305
  Outcome:
306
 
307
  - v13.2 Scrub Key import/reload UI is completed, app-verified and closed.
@@ -333,6 +270,6 @@ Outcome:
333
 
334
  Possible directions:
335
 
336
- - Deterministic reinsert UI implementation.
337
- - AI-output reinsert.
338
  - Further recognizer expansion by legal domain.
 
26
 
27
  ---
28
 
29
+ ## v13.3 — Deterministic reinsert UI implementation
30
+
31
+ Status: implemented; awaiting GitHub Actions, Hugging Face sync and app verification.
32
+
33
+ Purpose:
34
+
35
+ - Add the deterministic local reinsert UI described in `REINSERT_UI_SPEC.md`.
36
+ - Let the user paste scrubbed or AI-generated text and locally restore mapped placeholders using a validated Scrub Key.
37
+ - Show restored text, an audit summary and a `.txt` download for restored text.
38
+ - Keep the step local and deterministic, with no AI calls and no cloud processing.
39
+
40
+ Files added or changed:
41
+
42
+ - `fix_streamlit_nested_expanders.py`
43
+ - `tests/test_scrub_key_reinsert_ui_patch.py`
44
+ - `tests/test_scrub_key_ui_patch.py`
45
+ - `WORKPACKAGES.md`
46
+ - `CHANGELOG.md`
47
+ - `handover/workpackages/20260607_1915_v13_3_reinsert_ui_implementation.md`
48
+
49
+ Main changes:
50
+
51
+ - Added import/wiring for the verified helper:
52
+ - `from scrub_key_reinsert import reinsert_from_scrub_key`.
53
+ - Added the section `Originele waarden terugzetten` after the existing Scrub Key import/reload area.
54
+ - Added the input label `Plak hier de tekst waarin u originele waarden lokaal wilt terugzetten`.
55
+ - Added the explicit action button `Zet originele waarden lokaal terug`.
56
+ - Added local helper call:
57
+ - `reinsert_from_scrub_key(reinsert_input_text, active_reinsert_scrub_key)`.
58
+ - Added output label `Herstelde tekst`.
59
+ - Added `Download herstelde tekst (.txt)` with `text/plain` output.
60
+ - Added `Controleverslag terugzetten` audit summary.
61
+ - Added audit rendering for item count, active item count, excluded item count, replacement count, placeholders not found, unknown placeholders, duplicate placeholders, validation issues, local-only status, AI-processing status and cloud-processing status.
62
+ - Added visible warning that restored text may again contain personal or confidential information and must be reviewed before sharing.
63
+ - Added local/no-AI/no-cloud wording.
64
+ - Stores a successfully imported Scrub Key in `st.session_state["active_scrub_key"]` for local reinsert use.
65
+ - Falls back to the currently built Scrub Key from reviewed replacement rows if no imported key is active.
66
+
67
+ Testing and validation:
68
+
69
+ - Added `tests/test_scrub_key_reinsert_ui_patch.py`.
70
+ - Updated `tests/test_scrub_key_ui_patch.py` so it no longer forbids the intentionally added reinsert flow, while still guarding no-AI, no-cloud and no-automatic-document-rehydration boundaries.
71
+ - Local targeted validation on a reconstructed subset passed:
72
+ - `PYTHONPATH=. pytest -q tests/test_scrub_key.py tests/test_scrub_key_import.py tests/test_scrub_key_reinsert.py tests/test_scrub_key_reinsert_ui_patch.py tests/test_scrub_key_import_ui_patch.py tests/test_scrub_key_ui_patch.py` → 57 passed.
73
+ - Full repository test suite was not run from this connector environment.
74
+ - GitHub Actions are pending for WP8B commits.
75
+ - Hugging Face sync is pending for WP8B commits.
76
+ - App verification is pending because UI behavior changed.
77
+
78
+ Intentionally not changed:
79
+
80
+ - No direct edit to `presidio_streamlit.py`.
81
+ - No edit to `scrub_key_reinsert.py`.
82
+ - No edit to `scrub_key.py`.
83
+ - No edit to `scrub_key_import.py`.
84
+ - No AI calls.
85
+ - No cloud processing.
86
+ - No automatic document rehydration.
87
+ - No DOCX/PDF reinsert.
88
+ - No TXT, CSV, DOCX or PDF scrubbed export behavior changed.
89
+ - No Scrub Key JSON export behavior intentionally changed.
90
+ - No Scrub Key import/reload behavior intentionally changed except storing the validated imported key in session state for reinsert use.
91
+ - No silent overwrite of existing review rows.
92
+ - No secrets, tokens or real personal data.
93
+
94
+ Outcome:
95
+
96
+ - v13.3 deterministic local reinsert UI is implemented and awaits external verification and app testing.
97
+
98
+ ---
99
+
100
  ## v13.3 — Deterministic reinsert UI planning
101
 
102
+ Status: implemented; reinsert UI implementation completed in WP8B and awaits verification.
103
 
104
  Purpose:
105
 
 
150
  - no-AI status;
151
  - no-cloud status.
152
 
 
 
 
 
 
153
  Testing and validation:
154
 
155
  - Tests: not applicable; planning/specification-only workpackage.
156
+ - App verification: not applicable; no UI behavior changed in WP8 planning.
157
 
158
+ Intentionally not changed in planning phase:
159
 
160
  - No UI code changed.
161
  - No direct edit to `fix_streamlit_nested_expanders.py`.
 
171
 
172
  Outcome:
173
 
174
+ - v13.3 deterministic reinsert UI was planned and then implemented in WP8B.
175
 
176
  ---
177
 
 
186
  - Confirm that the helper remains pure, local and deterministic.
187
  - Preserve the boundary that no UI, AI-output flow, cloud processing or export/download behavior change was added.
188
 
 
 
 
 
 
 
189
  Verification evidence:
190
 
191
  - Tests #106 green — commit `5854dbf`.
 
203
  - Hugging Face sync: green based on coordinator evidence.
204
  - App verification: not applicable, helper-only package.
205
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  Outcome:
207
 
208
  - v13.3 deterministic reinsert helper is completed and formally closed.
209
 
210
  ---
211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  ## v13.2 — Scrub Key import/reload UI app verification closeout
213
 
214
  Status: completed, app-verified and closed.
 
219
  - Record that the implemented import/reload flow works in the Hugging Face app.
220
  - Preserve the boundary that this phase is import/reload only and does not add AI-output reinsert.
221
 
 
 
 
 
 
 
222
  Technical evidence already recorded:
223
 
224
  - Tests #89 green — commit `83353e4`.
 
239
  - Existing `Download Scrub Key (.json)` remains visible.
240
  - Existing TXT, CSV, DOCX and PDF downloads remain available.
241
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  Outcome:
243
 
244
  - v13.2 Scrub Key import/reload UI is completed, app-verified and closed.
 
270
 
271
  Possible directions:
272
 
273
+ - Deterministic reinsert UI verification and closeout.
274
+ - AI-output reinsert workflow review.
275
  - Further recognizer expansion by legal domain.