Add community node socket: devices, tickets, consent gate, kill switch

Phase 3 of plan.md. Device registration with one-time secrets, scoped single-use
socket tickets, the lock-owner WS /nodes/ws with handshake and heartbeat eviction,
a single batch ConsentGate, and NodesService which disconnects nodes within one tick
when consent, device or the nodes_enabled kill switch changes. A reconcile of 2000
sessions measured about 110 ms after replacing per-session queries with batches.
Devii may withdraw but never grant bandwidth_sharing.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-14 09:14:53 +02:00
co-authored by Claude Sonnet 5.5
parent fad41d0fbe
commit 42b81271b8
41 changed files with 2166 additions and 22 deletions
+11 -2
View File
@@ -2,7 +2,7 @@
retoor <retoor@molodetz.nl>
Every state-changing action in DevPlace records one append-only row through `devplacepy/services/audit/record.py` (`record` for a request-scoped actor, `record_system` for a background one). This file is the authoritative catalogue of the 360 event keys currently emitted, grouped by the category `services/audit/categories.py` `category_for` resolves them to.
Every state-changing action in DevPlace records one append-only row through `devplacepy/services/audit/record.py` (`record` for a request-scoped actor, `record_system` for a background one). This file is the authoritative catalogue of the 362 event keys currently emitted, grouped by the category `services/audit/categories.py` `category_for` resolves them to.
## Rules
@@ -36,6 +36,7 @@ Every state-changing action in DevPlace records one append-only row through `dev
| `message` | 2 |
| `moderation` | 12 |
| `news` | 9 |
| `nodes` | 3 |
| `notification` | 4 |
| `project` | 12 |
| `project_files` | 14 |
@@ -48,7 +49,7 @@ Every state-changing action in DevPlace records one append-only row through `dev
| `telegram` | 5 |
| `tools` | 12 |
**Total: 359 keys.**
**Total: 362 keys.**
## Account and profile (`account`)
@@ -543,6 +544,14 @@ Every state-changing action in DevPlace records one append-only row through `dev
| `telegram.send` | `services/devii/actions/dispatcher.py` |
| `telegram.unpair` | `routers/profile/telegram.py` |
## Community nodes (`nodes`)
| Event key | Recorded in |
|---|---|
| `node.device.create` | `routers/nodes/devices.py` |
| `node.device.delete` | `routers/nodes/devices.py` |
| `node.device.rotate` | `routers/nodes/devices.py` |
## Developer tools (`tools`)
| Event key | Recorded in |