solidprivacy-nl commited on
Commit
70dafad
·
1 Parent(s): 546cac8

Add WP43 frontend architecture decision tests

Browse files
tests/test_frontend_architecture_decision.py ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ from pathlib import Path
4
+
5
+
6
+ REPO_ROOT = Path(__file__).resolve().parents[1]
7
+ DECISION = REPO_ROOT / "FRONTEND_ARCHITECTURE_DECISION.md"
8
+
9
+
10
+ def _text() -> str:
11
+ return DECISION.read_text(encoding="utf-8")
12
+
13
+
14
+ def test_wp43_keeps_streamlit_for_mvp_and_rejects_frontend_migration_now():
15
+ text = _text().lower()
16
+
17
+ assert "keep streamlit as the mvp validation surface for now" in text
18
+ assert "do not migrate to a separate frontend yet" in text
19
+ assert "do not build a professional document editor yet" in text
20
+ assert "stay with streamlit for mvp validation" in text
21
+
22
+
23
+ def test_wp43_requires_thin_ui_and_helper_first_architecture():
24
+ text = _text().lower()
25
+
26
+ assert "thin ui patch layer" in text
27
+ assert "reusable python helper modules" in text
28
+ assert "contract tests before ui integration" in text
29
+ assert "helper/model and tests before ui integration" in text
30
+ assert "the ui should stay thin" in text
31
+
32
+
33
+ def test_wp43_blocks_unapproved_professional_document_editor_features():
34
+ text = _text().lower()
35
+
36
+ for required in [
37
+ "a broad professional document editor",
38
+ "click-to-mark sensitive text as an authoritative workflow",
39
+ "complex synchronized multi-pane editing",
40
+ "word/pdf layout rendering",
41
+ "long-document virtualized review",
42
+ "export blocking based on ui-only state",
43
+ "direct scrub key mutation from new panels",
44
+ "replacing the current review table without a separate migration plan",
45
+ ]:
46
+ assert required in text
47
+
48
+
49
+ def test_wp43_sets_frontend_reconsideration_criteria():
50
+ text = _text().lower()
51
+
52
+ assert "when to reconsider a separate frontend" in text
53
+ assert "document-centric review needs interaction beyond static/read-only aids" in text
54
+ assert "users validate the need" in text
55
+ assert "mvp logic is stable enough" in text
56
+ assert "profiles, batch review or enterprise deployment" in text
57
+
58
+
59
+ def test_wp43_preserves_privacy_and_local_first_boundaries():
60
+ text = _text().lower()
61
+
62
+ for required in [
63
+ "python core remains source of truth",
64
+ "api boundary is local-first",
65
+ "no cloud document processing",
66
+ "no hidden telemetry",
67
+ "review/export/scrub key actions stay explicit and auditable",
68
+ "no real-data fixtures",
69
+ ]:
70
+ assert required in text
71
+
72
+
73
+ def test_wp43_does_not_close_wp42d_verification_or_change_ui():
74
+ text = _text().lower()
75
+
76
+ assert "wp43 does not validate or close wp42d" in text
77
+ assert "wp42d remains pending" in text
78
+ for required in [
79
+ "does not change:",
80
+ "presidio_streamlit.py",
81
+ "fix_streamlit_nested_expanders.py",
82
+ "any streamlit patch file",
83
+ "review table behavior",
84
+ "export/download behavior",
85
+ "scrub key behavior",
86
+ "reinsert behavior",
87
+ "helper runtime behavior",
88
+ "dependencies",
89
+ "docker/runtime behavior",
90
+ "cloud processing",
91
+ "real-data fixtures",
92
+ ]:
93
+ assert required in text