Monorepo for Aesthetic.Computer aesthetic.computer
4
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 215 lines 5.5 kB view raw view rendered
1# Moods ATProto Integration - Implementation Checklist 2 3**Start Date:** _____ 4**Target Completion:** _____ 5**Status:** 🟡 Not Started 6 7--- 8 9## ✅ Phase 1: Lexicon Creation & Testing (Week 1) 10 11- [ ] Create lexicon deployment script `create-mood-lexicon.mjs` 12- [ ] Deploy lexicon to PDS 13- [ ] Validate lexicon with `@atproto/lexicon` 14- [ ] Create test mood record manually via PDS admin API 15- [ ] Query test record with `com.atproto.repo.listRecords` 16- [ ] Verify record in ATProto firehose (if applicable) 17 18**Blocker Notes:** 19 20--- 21 22## ✅ Phase 2: Backend Integration (Week 1-2) 23 24### 2.1: Create Helper Functions 25- [ ] Create `/system/backend/mood-atproto.mjs` 26 - [ ] `createAtprotoMood()` function 27 - [ ] `deleteAtprotoMood()` function 28 - [ ] `deleteAllAtprotoMoods()` function 29- [ ] Add unit tests for helper functions 30- [ ] Test with mock user data 31 32### 2.2: Update Mood Function 33- [ ] Update `/system/netlify/functions/mood.mjs` 34 - [ ] Import `createAtprotoMood` 35 - [ ] Add dual-write after MongoDB insert 36 - [ ] Add MongoDB update with ATProto URI 37 - [ ] Add error handling for ATProto failures 38- [ ] Test locally with single user 39- [ ] Verify MongoDB record has `atproto` field 40- [ ] Verify ATProto record exists via PDS query 41- [ ] Deploy to production with feature flag (optional) 42 43**Blocker Notes:** 44 45--- 46 47## ✅ Phase 3: Deletion Sync (Week 2) 48 49- [ ] Update `/system/netlify/functions/delete-erase-and-forget-me.mjs` 50 - [ ] Import `deleteAllAtprotoMoods` 51 - [ ] Add ATProto deletion after MongoDB deletion 52 - [ ] Add error handling 53- [ ] Test account deletion with test user 54- [ ] Verify MongoDB moods deleted 55- [ ] Verify ATProto moods deleted 56- [ ] Query PDS to confirm no orphaned records 57- [ ] Deploy to production 58 59**Blocker Notes:** 60 61--- 62 63## ✅ Phase 4: Backfill Historical Moods (Week 2-3) 64 65### 4.1: Create Migration Script 66- [ ] Create `/at/scripts/migrate-moods-to-atproto.mjs` 67 - [ ] Implement dry-run mode 68 - [ ] Implement single-user migration 69 - [ ] Implement batch migration 70 - [ ] Add rate limiting (100ms delay) 71 - [ ] Add progress logging 72 - [ ] Add error handling 73 74### 4.2: Run Migration 75- [ ] Run dry-run for all users 76- [ ] Review dry-run output 77- [ ] Test single-user migration (`@jeffrey`) 78- [ ] Verify test user's moods in ATProto 79- [ ] Run migration for first 10 users 80- [ ] Monitor for errors/rate limits 81- [ ] Run migration for all users 82- [ ] Monitor MongoDB + PDS during migration 83- [ ] Verify random sample of migrated moods 84 85**Blocker Notes:** 86 87**Migration Stats:** 88- Total users: _____ 89- Users with ATProto: _____ 90- Total moods: _____ 91- Moods migrated: _____ 92- Moods failed: _____ 93 94--- 95 96## ✅ Phase 5: Testing & Verification (Week 3) 97 98### 5.1: Create Audit Script 99- [ ] Create `/at/scripts/audit-mood-atproto-sync.mjs` 100 - [ ] Single-user audit 101 - [ ] Batch audit 102 - [ ] MongoDB vs ATProto comparison 103 - [ ] Summary statistics 104 105### 5.2: Run Tests 106- [ ] Unit test: Create mood with ATProto account 107- [ ] Unit test: Create mood without ATProto account 108- [ ] Unit test: Create duplicate mood (no duplicate ATProto) 109- [ ] Unit test: Soft delete mood (nuke) 110- [ ] Unit test: Hard delete account 111- [ ] Integration test: New signup → create mood 112- [ ] Integration test: Existing user → create mood 113- [ ] Integration test: Delete account 114- [ ] Audit single user 115- [ ] Audit first 10 users 116- [ ] Audit first 50 users 117- [ ] Audit all users with ATProto 118 119### 5.3: Verification 120- [ ] Check MongoDB counts match ATProto 121- [ ] Verify no orphaned records 122- [ ] Check for sync failures in logs 123- [ ] Review error rates 124- [ ] Verify deletion works correctly 125 126**Blocker Notes:** 127 128**Test Results:** 129- Sync success rate: _____% 130- Average sync latency: _____ms 131- Moods with ATProto URI: _____ 132- Moods missing ATProto: _____ 133 134--- 135 136## ✅ Phase 6: Monitoring & Documentation (Week 3-4) 137 138### 6.1: Monitoring 139- [ ] Set up alerts for sync failures 140- [ ] Set up dashboard for sync metrics 141- [ ] Add logging for ATProto operations 142- [ ] Create runbook for troubleshooting 143 144### 6.2: Documentation 145- [ ] Update `/at/README.md` with moods lexicon 146- [ ] Add mood sync to `/at/MANIFEST.md` 147- [ ] Update API docs for mood endpoint 148- [ ] Add moods to `/at/QUICK-REFERENCE.md` 149- [ ] Document rollback procedure 150- [ ] Create troubleshooting guide 151 152**Blocker Notes:** 153 154--- 155 156## ✅ Phase 7: Production Launch (Week 4) 157 158- [ ] Review all tests passing 159- [ ] Review monitoring dashboards 160- [ ] Review error logs (should be minimal) 161- [ ] Enable for 100% of users 162- [ ] Monitor for 48 hours 163- [ ] Address any issues 164- [ ] Mark project complete ✅ 165 166**Launch Stats:** 167- Launch date: _____ 168- Total moods: _____ 169- Sync rate: _____% 170- Error rate: _____% 171 172--- 173 174## 🚨 Issues & Blockers 175 176**Issue #1:** 177- Description: _____ 178- Status: _____ 179- Resolution: _____ 180 181**Issue #2:** 182- Description: _____ 183- Status: _____ 184- Resolution: _____ 185 186--- 187 188## 📊 Final Metrics 189 190- **Total users with ATProto:** _____ 191- **Total moods in MongoDB:** _____ 192- **Total moods in ATProto:** _____ 193- **Sync success rate:** _____% 194- **Average sync latency:** _____ms 195- **Failed syncs:** _____ 196- **Manual fixes required:** _____ 197 198--- 199 200## ✨ Project Sign-Off 201 202- [ ] All phases complete 203- [ ] All tests passing 204- [ ] Documentation complete 205- [ ] Monitoring in place 206- [ ] Team notified 207- [ ] Project retrospective completed 208 209**Completed by:** _____ 210**Completion date:** _____ 211 212--- 213 214**Next Steps:** 215See `MOODS-ATPROTO-INTEGRATION-PLAN.md` for detailed implementation guide.