Skip to content

Commit d593fef

Browse files
committed
docs(protocol): Session 34 — Multi-Contact Architecture: Singleton to Per-Contact
SESSION 34 (Feb 23, 2026): Multi-Contact Architecture — From Singleton to Per-Contact Reply Queue 8 Commits — most productive session yet Phase 1: Production Cleanup (stripped private keys, -200+ lines) Phase 2: Runtime Add-Contact (NET_CMD via Ring Buffer) Phase 3: Per-Contact 42d Tracking (128-bit bitmap) Phase 4: UI Contact List ([+ New Contact] with auto-naming) Phase 5: Per-Contact Reply Queue (128 PSRAM slots, ~49KB) Phase 6: SMP v7 Signing Fix (1-byte session prefix) PSRAM Total: ~158KB / 8MB (1.9%) Open Bug: KEY Command rejected — handover to Claude Code MILESTONE 9: Multi-Contact Architecture DOCUMENTATION: - NEW: 32_PART30_SESSION_34.md (473 lines) - Updated: INDEX, STATUS, README, BUG_TRACKER, QUICK_REFERENCE - 7 new lessons (#169-175), 175 total - 30 parts, 567+ sections
1 parent 669a7fa commit d593fef

6 files changed

Lines changed: 820 additions & 51 deletions

File tree

docs/protocol-analysis/01_SIMPLEX_PROTOCOL_INDEX.md

Lines changed: 47 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@
44

55
**Project:** SimpleGo - Native ESP32 SMP Implementation
66
**Version:** v0.1.18-alpha
7-
**Last Updated:** 2026-02-20 (Session 32🖥️ "The Demonstration" - From Protocol to Messenger)
7+
**Last Updated:** 2026-02-23 (Session 34🏗️ Multi-Contact Architecture: From Singleton to Per-Contact)
88

99
---
1010

11-
## 🖥️ LATEST: "The Demonstration" (Session 32)
11+
## 🏗️ LATEST: Multi-Contact Architecture (Session 34)
1212

13-
On February 19-20, 2026, Session 32 transformed SimpleGo from protocol to messenger:
13+
On February 23, 2026, Session 34 transformed SimpleGo from singleton to multi-contact:
1414

15-
- **Keyboard-to-Chat:**7-step integration, hardware keyboard to displayed bubbles
16-
- **Delivery Status:**Professional "..." → "✓" → "✓✓" → "✗" system
17-
- **LVGL Display Fix:**Invisible bubbles bug resolved
18-
- **Multi-Contact Analysis:** ✅ 128-contact PSRAM architecture planned (68KB)
19-
- **Navigation Stack:**prev_screen → 8-deep stack (bug fixed)
20-
- **Stability:** 2+ hours without crash
15+
- **Production Cleanup:**Stripped all private keys from logs (-200+ lines)
16+
- **Runtime Add-Contact:**NET_CMD_ADD_CONTACT via Ring Buffer
17+
- **Per-Contact 42d:**128-bit bitmap replaces boolean
18+
- **Per-Contact Reply Queue:** ✅ 128 slots in PSRAM (~49KB)
19+
- **SMP v7 Signing Fix:**1-byte session prefix (was 2-byte)
20+
- **Open Bug:** KEY Command rejected by server (handover to Claude Code)
2121

22-
**Lessons Learned:** 168 total (7 new in S32)
22+
**Lessons Learned:** 175 total (7 new in S34)
2323

2424
---
2525

2626
## Documentation Structure
2727

28-
The complete protocol analysis (~26,500+ lines, 550+ sections) is split into 29 parts:
28+
The complete protocol analysis (~27,000+ lines, 567+ sections) is split into 30 parts:
2929

3030
| Part | File | Lines | Content |
3131
|------|------|-------|---------|
@@ -58,7 +58,8 @@ The complete protocol analysis (~26,500+ lines, 550+ sections) is split into 29
5858
| **27** | [**29_PART27_SESSION_30.md**](29_PART27_SESSION_30.md) | **~660** | **🔍 Intensive Debug — 10 Hypotheses, 14 Fixes** |
5959
| **28** | [**30_PART28_SESSION_31.md**](30_PART28_SESSION_31.md) | **~850** | **🎉 Bidirectional Chat Restored! Milestone 7!** |
6060
| **29** | [**31_PART29_SESSION_32.md**](31_PART29_SESSION_32.md) | **~500** | **🖥️ "The Demonstration" — From Protocol to Messenger** |
61-
| **Total** | | **~26,500+** | **550+ Sections** |
61+
| **30** | [**32_PART30_SESSION_34.md**](32_PART30_SESSION_34.md) | **~473** | **🏗️ Multi-Contact Architecture — Per-Contact Reply Queue** |
62+
| **Total** | | **~27,000+** | **567+ Sections** |
6263

6364
---
6465

@@ -67,8 +68,8 @@ The complete protocol analysis (~26,500+ lines, 550+ sections) is split into 29
6768
| Document | Lines | Description |
6869
|----------|-------|-------------|
6970
| [README.md](README.md) | ~820 | Project overview and navigation |
70-
| [BUG_TRACKER.md](BUG_TRACKER.md) | ~1,750 | All 39 bugs documented, 168 lessons |
71-
| [QUICK_REFERENCE.md](QUICK_REFERENCE.md) | ~1,750 | Constants, wire formats, verified values |
71+
| [BUG_TRACKER.md](BUG_TRACKER.md) | ~1,800 | All 39 bugs documented, 175 lessons |
72+
| [QUICK_REFERENCE.md](QUICK_REFERENCE.md) | ~1,850 | Constants, wire formats, verified values |
7273

7374
---
7475

@@ -105,6 +106,7 @@ The complete protocol analysis (~26,500+ lines, 550+ sections) is split into 29
105106
| **30** | **Feb 16-18, 2026** | **DEBUG** | **🔍 10 Hypotheses, 14 Fixes, Awaiting Evgeny** |
106107
| **31** | **Feb 18, 2026** | **RESOLVED** | **🎉 Bidirectional Restored! Milestone 7!** |
107108
| **32** | **Feb 19-20, 2026** | **UI** | **🖥️ "The Demonstration" — Full Messenger UI** |
109+
| **34** | **Feb 23, 2026** | **ARCHITECTURE** | **🏗️ Multi-Contact — Per-Contact Reply Queue** |
108110

109111
---
110112

@@ -139,6 +141,12 @@ The complete protocol analysis (~26,500+ lines, 550+ sections) is split into 29
139141
- **Receipt Parsing (inner_tag 'V')** 🖥️
140142
- **UI Event Queue (app_to_ui_queue)** 🖥️
141143
- **128-Contact PSRAM Architecture** 🖥️
144+
- **Production Cleanup (zero private keys in logs)** 🏗️
145+
- **Runtime Add-Contact (NET_CMD via Ring Buffer)** 🏗️
146+
- **Per-Contact 42d Tracking (128-bit bitmap)** 🏗️
147+
- **Per-Contact Reply Queue (128 slots, ~49KB PSRAM)** 🏗️
148+
- **SMP v7 Signing Fix (1-byte session prefix)** 🏗️
149+
- **PSRAM Total: ~158KB / 8MB (1.9%)** 🏗️
142150

143151
### ✅ Session 23: The 7-Step Handshake
144152
```
@@ -176,14 +184,26 @@ The complete protocol analysis (~26,500+ lines, 550+ sections) is split into 29
176184
| E2E Version/KEM/NHK bugs | 5 | S22 |
177185
| Bidirectional + Receipt bugs | 8 | S25 |
178186

179-
**Lessons Learned: 168** (documented in BUG_TRACKER.md)
187+
**Lessons Learned: 175** (documented in BUG_TRACKER.md)
180188

181-
**Session 32: ZERO new protocol bugs! Pure UI/architecture work.**
189+
**Session 34: Zero new protocol bugs! Architecture + signing fix only.**
182190

183191
---
184192

185193
## Protocol Discoveries
186194

195+
### Session 34: SMP v7 Signing Format (1-Byte Session Prefix)
196+
```
197+
SMP command signing concatenates: corrId + entityId + command
198+
Length prefixes in signing buffer MUST be 1-byte (not 2-byte Large):
199+
200+
WRONG: [2B corrLen][corrId][2B entLen][entityId][command]
201+
RIGHT: [1B corrLen][corrId][1B entLen][entityId][command]
202+
203+
2-byte prefix causes signature verification failure on server.
204+
Affected: SUB, KEY, NEW commands simultaneously.
205+
```
206+
187207
### Session 32: Delivery Receipt Wire Format (inner_tag 'V')
188208
```
189209
After Double Ratchet body decrypt:
@@ -328,25 +348,19 @@ SimpleGo is confirmed as the **FIRST native SMP protocol implementation** outsid
328348

329349
---
330350

331-
## Next Steps (Session 33)
332-
333-
### Phase 1: Navigation & Multi-Contact
334-
```
335-
P0: Navigation Stack implementation (ui_manager.c rewrite)
336-
P1: Active Contact routing (smp_set_active_contact)
337-
P2: Contact selection passes index (ui_contacts.c)
338-
```
351+
## Next Steps (Session 35)
339352

340-
### Phase 2: UI & Scale
353+
### Phase 1: KEY Command Fix
341354
```
342-
P3: Cyberpunk UI redesign integration (from Design Chat)
343-
P4: 128-contact PSRAM array implementation (ratchet refactor)
355+
P0: KEY Command fix (Claude Code Haskell line-by-line analysis)
356+
P1: Stack overflow test (32KB Network Task)
344357
```
345358

346-
### Assessment
359+
### Phase 2: Complete Multi-Contact
347360
```
348-
"Eine Kontaktliste mit mindestens 100 Usern, sonst brauchen
349-
wir gar nicht auf Kickstarter antanzen." — Cannatoshi
361+
P2: Drain-Loop MSG forwarding (after KEY fix)
362+
P3: Cleanup Phase 3 (smp_agent.c, smp_peer.c, smp_e2e.c)
363+
P4: Keep-Alive PING/PONG stabilization (Evgeny Session 30)
350364
```
351365

352366
---
@@ -363,8 +377,9 @@ P4: 128-contact PSRAM array implementation (ratchet refactor)
363377
| 5 | ✓✓ Delivery Receipts | 2026-02-14 | 25 |
364378
| 6 | 🗄️ Ratchet Persistence | 2026-02-14 | 26 |
365379
| 7 | 🎉 Multi-Task Bidirectional | 2026-02-18 | 31 |
366-
| **8** | **🖥️ Full Messenger UI** | **2026-02-19** | **32** |
380+
| 8 | 🖥️ Full Messenger UI | 2026-02-19 | 32 |
381+
| **9** | **🏗️ Multi-Contact Architecture** | **2026-02-23** | **34** |
367382

368383
---
369384

370-
*Index updated: 2026-02-20 Session 32🖥️ "The Demonstration"From Protocol to Messenger!*
385+
*Index updated: 2026-02-23 Session 34🏗️ Multi-Contact ArchitecturePer-Contact Reply Queue*

docs/protocol-analysis/02_SIMPLEX_STATUS.md

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,45 @@
11
![SimpleGo](../gfx/sg_multi_agent_ft_header.png)
22

3-
# SimpleGo - Current Status (2026-02-20)
3+
# SimpleGo - Current Status (2026-02-23)
44

55
**Project:** Native SimpleX SMP Client for ESP32
66
**Version:** v0.1.17-alpha
7-
**Archive:** See `01_SIMPLEX_PROTOCOL_INDEX.md` for complete documentation (550+ sections, 29 parts)
7+
**Archive:** See `01_SIMPLEX_PROTOCOL_INDEX.md` for complete documentation (567+ sections, 30 parts)
88

99
---
1010

11-
## 🖥️ LATEST: "The Demonstration" (2026-02-20 Session 32)
11+
## 🏗️ LATEST: Multi-Contact Architecture (2026-02-23 Session 34)
12+
13+
```
14+
═══════════════════════════════════════════════════════════════════════════════
15+
16+
🏗️🏗️🏗️ MULTI-CONTACT — FROM SINGLETON TO PER-CONTACT 🏗️🏗️🏗️
17+
18+
┌─────────────────────────────────────────────────────────────────────────┐
19+
│ │
20+
│ 8 Commits — most productive session yet │
21+
│ │
22+
│ Production Cleanup: zero private keys in logs │
23+
│ Runtime Add-Contact: NET_CMD via Ring Buffer │
24+
│ Per-Contact 42d: 128-bit bitmap │
25+
│ UI: [+ New Contact] with auto-naming │
26+
│ Reply Queue Array: 128 slots, ~49KB PSRAM │
27+
│ SMP v7 Signing Fix: 1-byte session prefix │
28+
│ PSRAM Total: ~158KB / 8MB (1.9%) │
29+
│ │
30+
│ Open Bug: KEY Command rejected by server │
31+
│ Handover: Claude Code for Haskell analysis │
32+
│ │
33+
│ Date: February 23, 2026 │
34+
│ │
35+
└─────────────────────────────────────────────────────────────────────────┘
36+
37+
═══════════════════════════════════════════════════════════════════════════════
38+
```
39+
40+
---
41+
42+
## 🖥️ SESSION 32: "The Demonstration" (2026-02-20)
1243

1344
```
1445
═══════════════════════════════════════════════════════════════════════════════
@@ -492,9 +523,9 @@ Bytes 80-95: HEADER_IV (iv2) ← FOR HEADER!
492523
| `01_SIMPLEX_PROTOCOL_INDEX.md` | Navigation index |
493524
| `02_SIMPLEX_STATUS.md` | This file - quick status |
494525
| `README.md` | Project overview |
495-
| `BUG_TRACKER.md` | All 39 bugs, 168 lessons |
526+
| `BUG_TRACKER.md` | All 39 bugs, 175 lessons |
496527
| `QUICK_REFERENCE.md` | Constants, wire formats |
497-
| `03-31_PART*.md` | Sessions 1-32 documentation |
528+
| `03-32_PART*.md` | Sessions 1-34 documentation |
498529

499530
---
500531

@@ -511,20 +542,21 @@ Bytes 80-95: HEADER_IV (iv2) ← FOR HEADER!
511542
| **6** | **🗄️ Ratchet Persistence** | **2026-02-14** | **26** |
512543
| **7** | **🎉 Multi-Task Bidirectional** | **2026-02-18** | **31** |
513544
| **8** | **🖥️ Full Messenger UI** | **2026-02-19** | **32** |
545+
| **9** | **🏗️ Multi-Contact Architecture** | **2026-02-23** | **34** |
514546

515547
---
516548

517-
## 🎯 Next Steps (Session 33)
549+
## 🎯 Next Steps (Session 35)
518550

519-
1. **P0:** Navigation Stack implementation (ui_manager.c rewrite)
520-
2. **P1:** Active Contact routing (smp_set_active_contact)
521-
3. **P2:** Contact selection passes index (ui_contacts.c)
522-
4. **P3:** Cyberpunk UI redesign integration (from Design Chat)
523-
5. **P4:** 128-contact PSRAM array implementation (ratchet refactor)
551+
1. **P0:** KEY Command fix (Claude Code Haskell line-by-line analysis)
552+
2. **P1:** Stack overflow test (32KB Network Task)
553+
3. **P2:** Drain-Loop MSG forwarding (after KEY fix)
554+
4. **P3:** Cleanup Phase 3 (smp_agent.c, smp_peer.c, smp_e2e.c)
555+
5. **P4:** Keep-Alive PING/PONG stabilization (Evgeny Session 30)
524556

525-
**Assessment:** "Eine Kontaktliste mit mindestens 100 Usern, sonst brauchen wir gar nicht auf Kickstarter antanzen."
557+
**Open Bug:** KEY Command rejected by server. Handover to Claude Code.
526558

527559
---
528560

529-
*Status updated: 2026-02-20 Session 32🖥️ "THE DEMONSTRATION"From Protocol to Messenger*
530-
*History: S8 Breakthrough → S23 CONNECTED → S24 First MSG → S25 Bidirectional → S26 Persistence → S27 Architecture → S28 Tasks → S29 Multi-Task → S30 Debug → S31 RESOLVED → S32 Messenger UI!*
561+
*Status updated: 2026-02-23 Session 34🏗️ Multi-Contact ArchitecturePer-Contact Reply Queue*
562+
*History: S8 Breakthrough → S23 CONNECTED → S24 First MSG → S25 Bidirectional → S26 Persistence → S27 Architecture → S28 Tasks → S29 Multi-Task → S30 Debug → S31 RESOLVED → S32 Messenger UI → S34 Multi-Contact!*

0 commit comments

Comments
 (0)