diff options
| author | Your Name <you@example.com> | 2026-05-19 03:18:04 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 03:18:04 +0530 |
| commit | eeb9d2d1dfd38dd19fa641e6f733c917a3d1d005 (patch) | |
| tree | 4a3e3cf14290992a87968a833d7f041c45a7bf3b /CHECKLIST-CVM-RELAY.md | |
| parent | 81f2dc52dc42d01c89dff45a5407ec40b8863052 (diff) | |
feat: CVM relay stability fix + MCP relay integration tests
Relay disconnect fix (cvm_server.c):
- TLS read timeout reduced from 15s to 1s (short poll loop)
- Ping timer fires every 30s independently of read activity
- Consecutive timeout counter (65s) detects real disconnects
- Handle relay close frames (opcode 0x08) explicitly
- Result: 120s+ stable connection (previously ~37s disconnect cycle)
MCP relay integration tests (17/17 pass via make test-cvm-mcp):
- MCP initialize roundtrip via relay.primal.net
- get_sessions returns session array
- get_usage returns metric/price/step fields
- Non-owner auth rejection (board silently drops)
- Owner control request passes after rejection test
Build fixes:
- Remove display/font/axs15231b/qrcode deps (from display branch, not here)
- Remove local_relay/relay_selector/sync_manager deps (from relay branch)
- Add esp_timer to CMakeLists REQUIRES
Host unit tests: 61/61 pass
Diffstat (limited to 'CHECKLIST-CVM-RELAY.md')
| -rw-r--r-- | CHECKLIST-CVM-RELAY.md | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/CHECKLIST-CVM-RELAY.md b/CHECKLIST-CVM-RELAY.md new file mode 100644 index 0000000..e7c512d --- /dev/null +++ b/CHECKLIST-CVM-RELAY.md | |||
| @@ -0,0 +1,35 @@ | |||
| 1 | # CVM Relay Stability Checklist | ||
| 2 | |||
| 3 | ## Pre-flight | ||
| 4 | - [x] Create worktree `/home/c03rad0r/esp32-tollgate-cvm-relay` | ||
| 5 | - [x] Create branch `feature/cvm-relay-stability` from master | ||
| 6 | - [x] Document plan in PLAN-CVM-RELAY.md | ||
| 7 | |||
| 8 | ## Task 3: Fix Relay Disconnect | ||
| 9 | - [x] Modify `cvm_relay_task()` inner loop: 1s TLS read timeout | ||
| 10 | - [x] Decouple ping timer from read success | ||
| 11 | - [x] Add consecutive-timeout counter for real disconnect detection | ||
| 12 | - [x] Handle relay close frames (opcode 0x08) | ||
| 13 | - [x] `make test-unit` passes (61/61) | ||
| 14 | - [x] Build firmware | ||
| 15 | - [x] Lock Board B: `make lock-b PHASE="cvm-relay-stability"` | ||
| 16 | - [x] Verify Board B port: `esptool.py --port /dev/ttyACM1 chip_id` | ||
| 17 | - [x] Flash Board B via `make flash-b` | ||
| 18 | - [x] Monitor serial: confirm WS connected, no disconnect in 120s | ||
| 19 | - [ ] Unlock Board B (deferred — may need more testing) | ||
| 20 | |||
| 21 | ## Task 1: Test get_sessions & get_usage via Relay | ||
| 22 | - [x] Write `tests/integration/test-cvm-mcp-relay.mjs` | ||
| 23 | - [x] Test: `get_sessions` returns JSON array via relay (0 active sessions) | ||
| 24 | - [x] Test: `get_usage` returns metric/price/step fields via relay | ||
| 25 | - [x] Both tests PASS on Board B (via `make test-cvm-mcp`) | ||
| 26 | |||
| 27 | ## Task 2: Test Non-Owner Auth Rejection via Relay | ||
| 28 | - [x] Test: non-owner request gets no response (12s wait) | ||
| 29 | - [x] Test: owner control request succeeds after non-owner test | ||
| 30 | - [x] Both tests PASS on Board B (via `make test-cvm-mcp`) | ||
| 31 | |||
| 32 | ## Final | ||
| 33 | - [x] `make test-unit` — 61 tests pass | ||
| 34 | - [x] Commit: 3 commits on feature/cvm-relay-stability | ||
| 35 | - [ ] Push to remote (nostr git relay down — will retry later) | ||