upleb.uk

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

summaryrefslogtreecommitdiff
path: root/docs/archive/2025-11-05-current-status.md
blob: 8de3fc5479cb904f6f6ed6f85aa52056b2af6f9e (plain)
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
# Current Status - GRASP-01 Testing Against ngit-relay

**Date:** November 5, 2025
**Status:** ✅ PROGRESSING - 6 tests passing, continuing with validation tests
**Focus:** Test against ngit-relay reference implementation

---

## ✅ Completed Tests

**Status:** 6/18 GRASP-01 Nostr relay tests passing

**Tests Completed:**

1. ✅ `test_accept_valid_repo_announcement` - Accepts valid repo announcements
2. ✅ `test_reject_repo_announcement_missing_clone_tag` - Rejects announcements without service in clone tag
3. ✅ `test_reject_repo_announcement_missing_relays_tag` - Rejects announcements without service in relays tag
4. ✅ `test_accept_valid_repo_state_announcement` - Accepts valid repository state announcements (kind 30618)
5. ✅ `test_custom_rejection_allowed` - Documents custom rejection is allowed
6. ✅ `test_spam_prevention_allowed` - Documents SPAM prevention is allowed

**Commits:**

- `fa9753e` - feat(grasp-audit): implement test_reject_repo_announcement_missing_clone_tag
- `ebdf177` - feat(grasp-audit): implement test_reject_repo_announcement_missing_relays_tag and test_accept_valid_repo_state_announcement

## 🚧 Current Test: test_accept_state_announcement_multiple_refs

**Status:** NOT STARTED

**Location:** `grasp-audit/src/specs/grasp01_nostr_relay.rs`

**What to do:**

1. Implement test that creates repo state announcement with multiple git refs
2. Include required d tag (repository identifier)
3. Include required maintainers tag
4. Include multiple r tags (e.g., main branch, develop branch, v1.0 tag)
5. Verify relay accepts it (event stored and retrievable)
6. Test against ngit-relay
7. Commit when passing

---

## 🔧 Critical Gotchas for Next Session

### nostr-sdk 0.43 API Changes

```rust
// ❌ WRONG (0.35 API)
event.id()
event.tags()
for tag in &event.tags { }

// ✅ CORRECT (0.43 API)
event.id
event.tags
for tag in event.tags.iter() { }
```

### Running Tests

```bash
# Always use nix develop
cd grasp-audit
nix develop -c cargo test --lib test_grasp01_nostr_relay_against_relay -- --ignored --nocapture

# ngit-relay can run on any available port
# Use RELAY_URL env var to specify: RELAY_URL="ws://localhost:PORT"
# Check status: docker ps | grep grasp-test-relay
```

### Test File Structure

```
grasp-audit/src/specs/
├── mod.rs                          # ✅ UPDATED - exports Grasp01NostrRelayTests
├── nip01_smoke.rs                  # ✅ DONE
└── grasp01_nostr_relay.rs          # 🚧 IN PROGRESS - fix compilation errors
```

---

## 📋 Test Implementation Strategy

### One Test at a Time Approach

**Current test:** `test_accept_valid_repo_announcement` (Phase 1, section 2.1)

**After fixing current test:**

1. Remove debug statements
2. Verify test passes against ngit-relay
3. Commit: "feat(grasp-audit): implement test_accept_valid_repo_announcement"
4. Move to next test: `test_reject_repo_announcement_missing_clone_tag`

### Test Organization

```
grasp-audit/src/specs/
├── mod.rs                          # ✅ UPDATED - Export all test modules
├── nip01_smoke.rs                  # ✅ DONE - Basic relay functionality
├── grasp01_nostr_relay.rs          # 🚧 IN PROGRESS - Nostr relay requirements
├── grasp01_git_http.rs             # 🔜 NEW - Git Smart HTTP requirements
└── grasp01_cors.rs                 # 🔜 NEW - CORS requirements
```

### Implementation Phases

**Phase 1: Nostr Relay Tests (18 tests total)**

- ✅ test_accept_valid_repo_announcement
- ✅ test_reject_repo_announcement_missing_clone_tag
- ✅ test_reject_repo_announcement_missing_relays_tag
- 🚧 test_accept_valid_repo_state_announcement (NEXT)
- ⏳ test_accept_state_announcement_multiple_refs
- ⏳ test_accept_state_announcement_no_refs
- ⏳ test_accept_event_tagging_repo_announcement
- ⏳ test_accept_event_tagged_by_repo
- ⏳ test_accept_patch_for_repo
- ⏳ test_accept_pull_request_for_repo
- ⏳ test_accept_issue_for_repo
- ⏳ test_accept_reply_to_issue
- ⏳ test_nip11_document_exists
- ⏳ test_nip11_supported_grasps_field
- ⏳ test_nip11_repo_acceptance_criteria_field
- ⏳ test_nip11_curation_field
- ✅ test_custom_rejection_allowed (always passes - policy test)
- ✅ test_spam_prevention_allowed (always passes - policy test)

**Phase 2: Git Smart HTTP Tests** - Not started
**Phase 3: CORS Tests** - Not started

---

## 📚 Key References

- `../grasp/01.md` - GRASP-01 spec (THE SOURCE OF TRUTH)
- `work/grasp01_test_plan.md` - Detailed test breakdown
- `grasp-audit/src/specs/nip01_smoke.rs` - Working example test structure
- `docs/learnings/nostr-sdk.md` - nostr-sdk 0.43 API changes

---

## 🎯 Immediate Next Actions

find out the next logical test to work on. build it, test it against ngit-relay and iterate until working. if no issues ask "are you happy to commit?" then commit it. task complete