diff options
| author | Christophe Besson <cbesson@gmail.com> | 2026-08-11 22:16:59 +0200 |
|---|---|---|
| committer | Christophe Besson <cbesson@gmail.com> | 2026-08-11 22:16:59 +0200 |
| commit | c66ee41d8476461939c5f4e7fdc71c5d7fb4a85c (patch) | |
| tree | 6aea861849ad38d6c3aa4a0fe9bc1ed5ae7dce9f /devel-phases-next.md | |
| parent | bbfc45925e82c364519b9d796758003365bc9005 (diff) | |
| download | meshbay-c66ee41d8476461939c5f4e7fdc71c5d7fb4a85c.tar.gz | |
feat(node): index push to WebRTC peers + swarm registration (11.5, 11.9)
When watchdog detects file changes, the daemon now:
- Pushes INDEX_SYNC to all connected WebRTC peers in that group
- Registers file hashes with hub /v1/swarm/register endpoint
Also registers all file hashes on startup for initial discovery.
hub_client: add register_swarm() method for bulk hash registration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'devel-phases-next.md')
| -rw-r--r-- | devel-phases-next.md | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/devel-phases-next.md b/devel-phases-next.md index 533f5e8..9a8b7ef 100644 --- a/devel-phases-next.md +++ b/devel-phases-next.md @@ -1,6 +1,6 @@ # MeshBay — Next Implementation Phases -> Base: Phases 1–11 complete (except 10.9 → Phase 13, 11.5/11.9 deferred). 169 tests. Web SPA + admin panel + self-service UI + MSE video streaming live on meshbay.org. Node daemon is now production-ready (WebRTC, WS, chat, HTTP all wired). +> Base: Phases 1–11 complete (except 10.9 → Phase 16). 171 tests. Web SPA + admin panel + self-service UI + MSE video streaming live on meshbay.org. Node daemon is production-ready (WebRTC, WS, chat, HTTP, index push, swarm all wired). > Architecture reference: docs/meshbay-draft-v4.md > First security review: first-review.md (2026-08-10) @@ -496,7 +496,7 @@ Browser Node ## Phase 11 — Node daemon: production-ready ✅ DONE -Pending commit — 169 tests. +Pending commit — 171 tests. **Objective:** the node daemon (`meshbay-node`) runs as a complete, self-contained service. Previously the daemon only started QUIC/TCP servers and the local web UI; @@ -521,8 +521,8 @@ services in a single process: 9. **Graceful shutdown** (enhanced) — cancels WS task, closes WebRTC peers, closes chat stores, stops HTTP/QUIC/TCP servers, stops indexers -**`hub_client.py`** — added `_ws` tracking and `send_ws()` method so the WebRTC -context can send `chat_notify` messages to the hub for real-time chat notifications. +**`hub_client.py`** — added `_ws` tracking, `send_ws()` for chat notifications, +and `register_swarm()` for file hash registration with the hub. **`config.py`** — added `data_dir` field (default `~/.local/share/meshbay/`) for chat DBs and other persistent state. @@ -530,6 +530,15 @@ for chat DBs and other persistent state. **`meshbay-node.service`** — updated systemd unit with `StateDirectory=meshbay`, `ProtectSystem=strict`, `ReadWritePaths` for config and data directories. +**Index push (11.5):** when watchdog detects file changes, the debounced +`on_change` callback fires `_on_index_change` on the daemon, which pushes a +full `INDEX_SYNC` to all WebRTC peers in that group. Only peers whose +`_group_id` matches receive the push. + +**Swarm registration (11.9):** on startup and on each index change, the daemon +registers all file hashes with the hub's `/v1/swarm/register` endpoint. This +allows other nodes/clients to discover which nodes host which content. + ### Milestones | # | Component | Status | @@ -538,12 +547,12 @@ for chat DBs and other persistent state. | 11.2 | Daemon: WebRTC transport | ✅ | | 11.3 | Daemon: chat store | ✅ | | 11.4 | Daemon: HTTP file API | ✅ | -| 11.5 | Daemon: index push on change | Deferred — indexer `on_change` callback not yet implemented | +| 11.5 | Daemon: index push on change | ✅ | | 11.6 | Daemon: node_user_id + hub_ws context | ✅ | | 11.7 | Daemon: graceful shutdown | ✅ | | 11.8 | Systemd unit file | ✅ | -| 11.9 | Swarm registration | Deferred — hub endpoint exists but node-side trigger not yet wired | -| 11.10 | Integration test | ✅ (2 tests: full lifecycle + no-groups-exit) | +| 11.9 | Swarm registration | ✅ | +| 11.10 | Integration test | ✅ (4 tests: lifecycle, no-groups, index push, group filtering) | ### File changes @@ -556,15 +565,6 @@ for chat DBs and other persistent state. **Added:** - `packages/meshbay-node/tests/test_daemon.py` — 2 integration tests -### Deferred items - -- **11.5 Index push**: requires `DirectoryIndexer` to have an `on_change` callback - that fires when watchdog detects file changes, then the daemon pushes `INDEX_DELTA` - to all connected WebRTC peers. The indexer currently rebuilds the full index but - doesn't notify consumers of incremental changes. -- **11.9 Swarm registration**: hub `/v1/swarm/register` endpoint exists. Node needs - to register file hashes after each index rebuild. Depends on 11.5 (index change events). - --- ## Phase 12 — Node CLI + management |