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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# WP41 — Highlight-based review prototype decision
|
| 2 |
+
|
| 3 |
+
Status: completed decision/documentation-only
|
| 4 |
+
Repository: `solidprivacy-nl/scrub`
|
| 5 |
+
|
| 6 |
+
## 1. Decision
|
| 7 |
+
|
| 8 |
+
The recommended next prototype direction is:
|
| 9 |
+
|
| 10 |
+
```text
|
| 11 |
+
A small text-based highlight review prototype, not a broad document UI rewrite.
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
The prototype should start with synthetic plain text and extracted DOCX main text only. It should show highlighted spans, selected finding details and table/audit linkage, but it must not change the current production review table, export/download behavior or Scrub Key behavior.
|
| 15 |
+
|
| 16 |
+
The recommended immediate next step is:
|
| 17 |
+
|
| 18 |
+
```text
|
| 19 |
+
WP42 — Streamlit feasibility boundary review
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
WP42 should decide whether this highlight prototype can safely be built in Streamlit or whether a separate frontend path is needed later.
|
| 23 |
+
|
| 24 |
+
## 2. Why not implement immediately?
|
| 25 |
+
|
| 26 |
+
Highlight review touches a risky UI area:
|
| 27 |
+
|
| 28 |
+
- document text rendering;
|
| 29 |
+
- clickable markers;
|
| 30 |
+
- synchronized state between document, detail pane and table;
|
| 31 |
+
- possible raw HTML rendering;
|
| 32 |
+
- accessibility and color meaning;
|
| 33 |
+
- large-document performance;
|
| 34 |
+
- export trust expectations.
|
| 35 |
+
|
| 36 |
+
Starting with a broad UI change would risk destabilizing the current table-first workflow. The safer next move is to decide the prototype boundary first, then review Streamlit feasibility, then implement a small prototype only after that boundary is clear.
|
| 37 |
+
|
| 38 |
+
## 3. Prototype goal
|
| 39 |
+
|
| 40 |
+
The goal of the future prototype is to answer:
|
| 41 |
+
|
| 42 |
+
```text
|
| 43 |
+
Can users review sensitive findings more reliably when they see them in document context instead of only in a table?
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
The prototype should test whether users can:
|
| 47 |
+
|
| 48 |
+
- see detected values in context;
|
| 49 |
+
- understand why a value was marked;
|
| 50 |
+
- distinguish sensitive values from legal/care context terms;
|
| 51 |
+
- identify missed sensitive values;
|
| 52 |
+
- inspect high-risk unresolved findings before export;
|
| 53 |
+
- still use the table as audit/control surface.
|
| 54 |
+
|
| 55 |
+
## 4. Recommended prototype scope
|
| 56 |
+
|
| 57 |
+
The first highlight prototype should support only:
|
| 58 |
+
|
| 59 |
+
- synthetic plain text;
|
| 60 |
+
- synthetic extracted DOCX main text;
|
| 61 |
+
- deterministic highlight spans from existing review rows or synthetic fixtures;
|
| 62 |
+
- read-only highlight display at first;
|
| 63 |
+
- a selected-finding detail panel;
|
| 64 |
+
- linkage back to table/audit rows;
|
| 65 |
+
- explicit unresolved-risk summary.
|
| 66 |
+
|
| 67 |
+
The first prototype should not support:
|
| 68 |
+
|
| 69 |
+
- exact Word layout rendering;
|
| 70 |
+
- PDF layout rendering;
|
| 71 |
+
- OCR;
|
| 72 |
+
- editing Word comments or tracked changes;
|
| 73 |
+
- automatic clean-DOCX export;
|
| 74 |
+
- export blocking;
|
| 75 |
+
- Scrub Key schema changes;
|
| 76 |
+
- real documents in repo;
|
| 77 |
+
- cloud document processing.
|
| 78 |
+
|
| 79 |
+
## 5. Highlight categories
|
| 80 |
+
|
| 81 |
+
The prototype should distinguish marker categories visually and textually.
|
| 82 |
+
|
| 83 |
+
Recommended categories:
|
| 84 |
+
|
| 85 |
+
```text
|
| 86 |
+
confirmed_sensitive
|
| 87 |
+
needs_review
|
| 88 |
+
candidate_missed_value
|
| 89 |
+
manual_added
|
| 90 |
+
preserve_context
|
| 91 |
+
high_risk_unresolved
|
| 92 |
+
hidden_content_warning
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
The UI must not rely on color alone. Each marker type should also have a label or icon/text cue.
|
| 96 |
+
|
| 97 |
+
## 6. Minimum interaction model
|
| 98 |
+
|
| 99 |
+
The first interactive version should be minimal:
|
| 100 |
+
|
| 101 |
+
1. Click or select a highlight.
|
| 102 |
+
2. Show the finding in a detail panel.
|
| 103 |
+
3. Show original text, proposed placeholder, entity type, source, reason and surrounding context.
|
| 104 |
+
4. Show linked table/audit row.
|
| 105 |
+
5. Allow no mutation in the first proof unless a later implementation package explicitly allows it.
|
| 106 |
+
|
| 107 |
+
The first proof should therefore be review-assistive, not authoritative.
|
| 108 |
+
|
| 109 |
+
## 7. Data model expectation
|
| 110 |
+
|
| 111 |
+
The prototype should use a simple non-sensitive span model:
|
| 112 |
+
|
| 113 |
+
```text
|
| 114 |
+
span_id
|
| 115 |
+
start_offset
|
| 116 |
+
end_offset
|
| 117 |
+
text
|
| 118 |
+
entity_type
|
| 119 |
+
source
|
| 120 |
+
review_status
|
| 121 |
+
replacement_preview
|
| 122 |
+
reason
|
| 123 |
+
context_before
|
| 124 |
+
context_after
|
| 125 |
+
```
|
| 126 |
+
|
| 127 |
+
Offsets must be zero-based and must refer to the text shown in the prototype. If text normalization changes offsets, the prototype must report that offsets are not reliable.
|
| 128 |
+
|
| 129 |
+
## 8. Security and privacy boundaries
|
| 130 |
+
|
| 131 |
+
The prototype must preserve current safety boundaries:
|
| 132 |
+
|
| 133 |
+
- no real data in fixtures;
|
| 134 |
+
- no cloud document processing;
|
| 135 |
+
- no telemetry;
|
| 136 |
+
- no hidden document upload;
|
| 137 |
+
- no silent export semantic change;
|
| 138 |
+
- no Scrub Key schema change;
|
| 139 |
+
- no automatic removal or cleaning;
|
| 140 |
+
- no claim that highlighted output is fully anonymized.
|
| 141 |
+
|
| 142 |
+
If HTML rendering is used, WP42 must address escaping/sanitization and whether user text can ever be rendered as raw HTML.
|
| 143 |
+
|
| 144 |
+
## 9. Accessibility requirements
|
| 145 |
+
|
| 146 |
+
The prototype should be usable without relying only on color.
|
| 147 |
+
|
| 148 |
+
Minimum requirements:
|
| 149 |
+
|
| 150 |
+
- text label for marker type;
|
| 151 |
+
- keyboard navigation expectation;
|
| 152 |
+
- readable contrast target;
|
| 153 |
+
- clear selected-marker state;
|
| 154 |
+
- warning summary for unresolved high-risk findings;
|
| 155 |
+
- no dense visual overload for long documents.
|
| 156 |
+
|
| 157 |
+
## 10. Options considered
|
| 158 |
+
|
| 159 |
+
### Option A — Static read-only highlighted text preview
|
| 160 |
+
|
| 161 |
+
Decision:
|
| 162 |
+
|
| 163 |
+
```text
|
| 164 |
+
Preferred first prototype shape.
|
| 165 |
+
```
|
| 166 |
+
|
| 167 |
+
Pros:
|
| 168 |
+
|
| 169 |
+
- smallest implementation surface;
|
| 170 |
+
- safest for online validation;
|
| 171 |
+
- avoids mutation logic;
|
| 172 |
+
- easier to test with synthetic text;
|
| 173 |
+
- lets users validate whether highlights improve review comprehension.
|
| 174 |
+
|
| 175 |
+
Cons:
|
| 176 |
+
|
| 177 |
+
- cannot yet add missed values by clicking;
|
| 178 |
+
- still needs later interaction design.
|
| 179 |
+
|
| 180 |
+
### Option B — Interactive click-to-review highlights in Streamlit
|
| 181 |
+
|
| 182 |
+
Decision:
|
| 183 |
+
|
| 184 |
+
```text
|
| 185 |
+
Candidate after WP42 feasibility review.
|
| 186 |
+
```
|
| 187 |
+
|
| 188 |
+
Pros:
|
| 189 |
+
|
| 190 |
+
- closer to desired UX;
|
| 191 |
+
- can synchronize document, detail pane and table;
|
| 192 |
+
- useful for online workflow testing.
|
| 193 |
+
|
| 194 |
+
Cons:
|
| 195 |
+
|
| 196 |
+
- may require fragile HTML/session-state handling;
|
| 197 |
+
- may not scale well for long documents;
|
| 198 |
+
- risks UI complexity in current Streamlit patch setup.
|
| 199 |
+
|
| 200 |
+
### Option C — Separate frontend prototype
|
| 201 |
+
|
| 202 |
+
Decision:
|
| 203 |
+
|
| 204 |
+
```text
|
| 205 |
+
Later candidate if Streamlit feasibility is poor.
|
| 206 |
+
```
|
| 207 |
+
|
| 208 |
+
Pros:
|
| 209 |
+
|
| 210 |
+
- better long-term document UX potential;
|
| 211 |
+
- stronger interaction model possible.
|
| 212 |
+
|
| 213 |
+
Cons:
|
| 214 |
+
|
| 215 |
+
- bigger architecture step;
|
| 216 |
+
- premature before Streamlit feasibility is reviewed;
|
| 217 |
+
- not suitable as the immediate next step.
|
| 218 |
+
|
| 219 |
+
## 11. Recommendation
|
| 220 |
+
|
| 221 |
+
Recommended sequence:
|
| 222 |
+
|
| 223 |
+
```text
|
| 224 |
+
1. WP42 — Streamlit feasibility boundary review.
|
| 225 |
+
2. If feasible: small static/read-only highlight prototype with synthetic text.
|
| 226 |
+
3. Only after that: controlled click-to-mark prototype.
|
| 227 |
+
4. If not feasible: frontend architecture decision before implementation.
|
| 228 |
+
```
|
| 229 |
+
|
| 230 |
+
This keeps the project aligned with the new roadmap rule: validate product logic and interface online first, but do not destabilize core workflow or start installer work too early.
|
| 231 |
+
|
| 232 |
+
## 12. Non-goals
|
| 233 |
+
|
| 234 |
+
WP41 does not implement:
|
| 235 |
+
|
| 236 |
+
- UI changes;
|
| 237 |
+
- clickable highlights;
|
| 238 |
+
- click-to-mark behavior;
|
| 239 |
+
- frontend migration;
|
| 240 |
+
- export/download changes;
|
| 241 |
+
- review table changes;
|
| 242 |
+
- Scrub Key behavior changes;
|
| 243 |
+
- DOCX cleaning;
|
| 244 |
+
- cloud processing;
|
| 245 |
+
- real-data fixtures.
|
| 246 |
+
|
| 247 |
+
## 13. Final decision
|
| 248 |
+
|
| 249 |
+
The project should pursue highlight-based review, but only as a small, bounded prototype after a Streamlit feasibility review.
|
| 250 |
+
|
| 251 |
+
The first prototype should be:
|
| 252 |
+
|
| 253 |
+
```text
|
| 254 |
+
read-only, text-based, synthetic, highlight-and-detail oriented, table-linked, and explicitly non-authoritative.
|
| 255 |
+
```
|
| 256 |
+
|
| 257 |
+
The next workpackage should be:
|
| 258 |
+
|
| 259 |
+
```text
|
| 260 |
+
WP42 — Streamlit feasibility boundary review
|
| 261 |
+
```
|