upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/docs/archive/2025-11-03-test-visual-summary.txt
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:19:40 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-12-03 11:19:40 +0000
commit2eaff5b79fed364d5eba5eb38e4b7bf76326884d (patch)
treedeacd6294f8860096ee82ee76930204efd65e33c /docs/archive/2025-11-03-test-visual-summary.txt
parent57bc8cd9c021feaf08e139e8fb62800bc476068e (diff)
remove docs archive
Diffstat (limited to 'docs/archive/2025-11-03-test-visual-summary.txt')
-rw-r--r--docs/archive/2025-11-03-test-visual-summary.txt297
1 files changed, 0 insertions, 297 deletions
diff --git a/docs/archive/2025-11-03-test-visual-summary.txt b/docs/archive/2025-11-03-test-visual-summary.txt
deleted file mode 100644
index cc45261..0000000
--- a/docs/archive/2025-11-03-test-visual-summary.txt
+++ /dev/null
@@ -1,297 +0,0 @@
1╔══════════════════════════════════════════════════════════════════════════════╗
2║ GRASP COMPLIANCE TEST TOOL PROPOSAL ║
3║ Visual Summary ║
4╚══════════════════════════════════════════════════════════════════════════════╝
5
6REQUIREMENT TO TEST
7═══════════════════
8"MUST serve a NIP-01 compliant nostr relay at / that accepts git repository
9announcements and their corresponding repo state announcements."
10
11
12THE BIG QUESTION
13════════════════
14Should we comprehensively test NIP-01, or just smoke test it?
15
16┌─────────────────────────────────────────────────────────────────────────────┐
17│ COMPREHENSIVE APPROACH │ OUR APPROACH (RECOMMENDED) │
18├─────────────────────────────────────────┼───────────────────────────────────┤
19│ • 50+ NIP-01 tests │ • 6 NIP-01 smoke tests │
20│ • 12 GRASP tests │ • 12 GRASP tests │
21│ • Total: 62+ tests │ • Total: 18 tests │
22│ • Time: 3-4 weeks │ • Time: 1 week │
23│ • Mostly redundant with rust-nostr │ • Focused on GRASP logic │
24│ • High maintenance burden │ • Low maintenance burden │
25└─────────────────────────────────────────┴───────────────────────────────────┘
26
27RECOMMENDATION: Our approach (18 tests, 1 week)
28REASON: rust-nostr already has 1000+ tests for NIP-01
29
30
31TEST BREAKDOWN
32══════════════
33
34┌───────────────────────────────────────────────────────────────────────┐
35│ NIP-01 SMOKE TESTS (6) │
36├───────────────────────────────────────────────────────────────────────┤
37│ │
38│ 1. websocket_connection → Can connect to / │
39│ 2. send_receive_event → Can send EVENT, get OK │
40│ 3. create_subscription → Can send REQ, get EOSE │
41│ 4. close_subscription → Can close subscriptions │
42│ 5. reject_invalid_event → Rejects bad signatures │
43│ 6. reject_invalid_event_id → Rejects wrong IDs │
44│ │
45│ PURPOSE: Verify basic relay works (not GRASP-specific) │
46│ TIME: 1-2 days │
47└───────────────────────────────────────────────────────────────────────┘
48
49┌───────────────────────────────────────────────────────────────────────┐
50│ GRASP-01 SPECIFIC TESTS (12) │
51├───────────────────────────────────────────────────────────────────────┤
52│ │
53│ ANNOUNCEMENT ACCEPTANCE │
54│ ──────────────────────── │
55│ 7. accepts_repository_announcement │
56│ 8. accepts_repository_state │
57│ │
58│ POLICY ENFORCEMENT │
59│ ────────────────── │
60│ 9. rejects_announcement_without_clone_tag │
61│ 10. rejects_announcement_without_relay_tag │
62│ 11. accepts_announcement_with_multiple_clones │
63│ │
64│ RELATED EVENTS │
65│ ────────────── │
66│ 12. accepts_events_tagging_announcement │
67│ 13. accepts_events_tagged_by_announcement │
68│ 14. rejects_events_tagging_rejected_announcement │
69│ │
70│ QUERIES & STATE │
71│ ─────────────── │
72│ 15. query_announcements_by_identifier │
73│ 16. query_state_events │
74│ 17. state_replaces_previous │
75│ │
76│ RELIABILITY │
77│ ─────────── │
78│ 18. concurrent_event_submission │
79│ │
80│ PURPOSE: Verify GRASP protocol requirements │
81│ TIME: 3-4 days │
82└───────────────────────────────────────────────────────────────────────┘
83
84
85WHAT WE LEVERAGE FROM RUST-NOSTR
86═════════════════════════════════
87
88┌──────────────────────────────────┐
89│ rust-nostr ALREADY TESTS: │
90├──────────────────────────────────┤
91│ ✅ Event validation │
92│ ✅ Signature verification │
93│ ✅ Event ID calculation │
94│ ✅ WebSocket handling │
95│ ✅ Subscription management │
96│ ✅ Filter matching │
97│ │
98│ 1000+ existing tests │
99└──────────────────────────────────┘
100
101 │ We use their library
102
103
104┌──────────────────────────────────┐
105│ WE TEST: │
106├──────────────────────────────────┤
107│ 🎯 GRASP policy enforcement │
108│ 🎯 Repo announcement logic │
109│ 🎯 Integration with Git service │
110│ │
111│ 18 focused tests │
112└──────────────────────────────────┘
113
114
115PROJECT STRUCTURE
116═════════════════
117
118grasp-compliance-tests/ ← Standalone, reusable crate
119├── src/
120│ ├── lib.rs ← Public API
121│ ├── client.rs ← HTTP/WebSocket/Git client
122│ ├── assertions.rs ← Spec-based assertions
123│ ├── fixtures.rs ← Event/repo builders
124│ └── specs/
125│ ├── nip01_smoke.rs ← 6 smoke tests
126│ └── grasp_01.rs ← 12 GRASP tests
127├── fixtures/
128│ ├── repos/ ← Test git repos
129│ ├── events/ ← Event JSON
130│ └── keys/ ← Test keypairs
131└── examples/
132 └── test_server.rs ← Test any GRASP server
133
134
135USAGE EXAMPLE
136═════════════
137
138use grasp_compliance_tests::*;
139
140#[tokio::main]
141async fn main() {
142 // Test ANY GRASP implementation
143 let client = GraspTestClient::new("http://localhost:8080");
144
145 // Run smoke tests
146 let smoke = test_nip01_smoke(&client).await;
147 smoke.print_report();
148
149 // Run GRASP tests
150 let grasp = test_grasp_01_relay(&client).await;
151 grasp.print_report();
152}
153
154
155EXAMPLE OUTPUT
156══════════════
157
158GRASP-01: Relay Requirements
159════════════════════════════════════════════════════════════
160
161✓ accepts_repository_announcement (GRASP-01:9-10)
162 Requirement: MUST accept NIP-34 repository announcements
163 Duration: 45ms
164
165✓ accepts_repository_state (GRASP-01:9-10)
166 Requirement: MUST accept NIP-34 repository state events
167 Duration: 32ms
168
169✗ rejects_announcement_without_clone_tag (GRASP-01:12-13)
170 Requirement: MUST reject announcements without clone tag
171 Error: Event was accepted but should have been rejected
172 Expected: OK response with ok=false
173 Got: OK response with ok=true
174 Duration: 28ms
175
176Results: 11/12 passed (91.7%)
177
178
179TIMELINE
180════════
181
182Week 1: Test Tool Foundation
183├── Day 1-2: Set up crate structure
184├── Day 3: Implement test client
185├── Day 4: Implement 6 smoke tests
186└── Day 5: Create fixtures & builders
187
188Week 2: GRASP Tests
189├── Day 1-2: Announcement tests (7-11)
190├── Day 3: Related event tests (12-14)
191├── Day 4: Query tests (15-17)
192└── Day 5: Concurrent test (18) + polish
193
194Week 3: Integration
195├── Day 1-2: Create ngit-grasp skeleton
196├── Day 3-4: Wire up nostr-relay-builder
197└── Day 5: First test run
198
199Week 4: Iteration
200├── Day 1-3: Fix failing tests
201├── Day 4: Documentation
202└── Day 5: Polish
203
204TOTAL: 4 weeks to prove the concept
205
206
207BENEFITS
208════════
209
210✅ Focused Testing
211 • 18 tests vs. 62+ redundant tests
212 • Test GRASP logic, not generic Nostr
213 • Fast execution (seconds, not minutes)
214
215✅ Reusable Tool
216 • Any GRASP implementation can use it
217 • Works with Go, Rust, Python, JavaScript
218 • Publish as standalone crate
219
220✅ Clear Failures
221 • Cite exact spec requirements
222 • Show expected vs. actual
223 • Actionable error messages
224
225✅ Maintainable
226 • Tests mirror spec structure
227 • Easy to add GRASP-02, GRASP-05
228 • Update when spec updates
229
230✅ Proof of Concept
231 • Validates architecture
232 • Shows rust-nostr integration works
233 • Demonstrates inline authorization
234
235
236DECISIONS NEEDED
237════════════════
238
2391. SCOPE
240 ☐ Agree with smoke tests approach?
241 ☐ 18 tests sufficient for first requirement?
242
2432. APPROACH
244 ☐ A: Test-first (write tests, then implement)
245 ☐ B: Parallel (tests and implementation together)
246 ☐ C: Implementation-first (code first, tests later)
247
248 RECOMMENDED: A (test-first)
249
2503. STRUCTURE
251 ☐ Separate crate from day one?
252 ☐ Start integrated, extract later?
253
254 RECOMMENDED: Separate from day one
255
2564. FIXTURES
257 ☐ Deterministic test keys?
258 ☐ Random test keys?
259 ☐ Configurable (both)?
260
261 RECOMMENDED: Deterministic (reproducible)
262
263
264NEXT STEPS
265══════════
266
2671. ✅ Review this proposal
2682. ✅ Answer decision questions
2693. ✅ Create test tool skeleton
2704. ✅ Implement smoke tests
2715. ✅ Implement GRASP tests
2726. ✅ Create minimal ngit-grasp
2737. ✅ Iterate until green
2748. ✅ Document and polish
275
276
277FILES CREATED
278═════════════
279
280• COMPLIANCE_TEST_PROPOSAL.md → Detailed proposal with code
281• REPORT_COMPLIANCE_TESTING.md → Executive summary
282• TEST_BREAKDOWN.md → Test-by-test breakdown
283• TEST_VISUAL_SUMMARY.txt → This file
284
285
286READY TO PROCEED?
287═════════════════
288
289Please review and advise on:
2901. Scope (smoke tests vs. comprehensive)
2912. Approach (test-first, parallel, or implementation-first)
2923. Any changes to the 18 proposed tests
2934. Priority of specific tests
294
295Once confirmed, implementation begins immediately.
296
297STATUS: ⏸️ Awaiting your decision