Initial Commit
This commit is contained in:
73
openspec/archive/2026-05-12-network-gundb-server/proposal.md
Normal file
73
openspec/archive/2026-05-12-network-gundb-server/proposal.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# OpenSpec Change: network-gundb-server
|
||||
|
||||
- **Change ID**: network-gundb-server
|
||||
- **Package**: `@suaveplan/network-gundb-server`
|
||||
- **Category**: server (Node-only)
|
||||
- **Target path**: `packages/network/network-gundb-server`
|
||||
- **Status**: PROPOSED
|
||||
- **Date**: 2026-05-11
|
||||
- **Parent**: `network-transport-family` (2026-05-11) — Wave 5
|
||||
- **Migration source**: `../suaveplan/packages/server/network-gundb-server` + `../suaveplan/enterprise/network-gundb-server.md`
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Migrate `@suaveplan/network-gundb-server` into genesis as a server-tier daemon. Hosts a GunDB relay peer for browser-tier `@suaveplan/network-discovery-gundb` clients to gossip against. The server publishes its endpoint via standard GunDB relay protocol; clients pass it as the relay URL in their Wave-2 discovery config.
|
||||
|
||||
---
|
||||
|
||||
## Current-state audit
|
||||
|
||||
Upstream source layout (`../suaveplan/packages/server/network-gundb-server/src/`): see `../suaveplan/enterprise/network-gundb-server.md` for full inventory.
|
||||
|
||||
---
|
||||
|
||||
## Parity Checklist
|
||||
|
||||
| Capability | Upstream | Migrated | Notes |
|
||||
|---|---|---|---|
|
||||
| Server daemon (Node) | ✅ | ✅ | |
|
||||
| GunDB relay endpoint | ✅ | ✅ | |
|
||||
| Per-connection data ops | ✅ | ✅ | |
|
||||
| Message handler | ✅ | ✅ | |
|
||||
| Connection lifecycle | ✅ | ✅ | |
|
||||
| Wire-payload Zod validation | 🚫 | ⬆️ | Tightened per the security flag on the upstream client audit. |
|
||||
| Structured errors | 🚫 | ⬆️ | `defineCodes` registry. |
|
||||
| Zod boundary validation | 🚫 | ⬆️ | Every public option struct. |
|
||||
| OTel instrumentation | 🚫 | ⬆️ | Spans + counters + histograms. |
|
||||
| AbortSignal | 🚫 | ⬆️ | Threaded everywhere. |
|
||||
| Health / readiness / liveness | 🚫 | ⬆️ | Via `@suaveplan/health-check` once that lands; otherwise inline endpoints. |
|
||||
| `export *` barrels | check | ⬆️ | Convert to explicit named exports per §6a. |
|
||||
| Test-runner imports | direct vitest | ⬆️ | Rewrite to `@suaveplan/testing/runner` per §7. |
|
||||
| 100% test coverage | 🚫 | ⬆️ | Bring to 100/100/100/100. |
|
||||
| Integration tests | partial | ⬆️ | Use `@suaveplan/testing-integration` for real-process tests; no mocks. |
|
||||
|
||||
---
|
||||
|
||||
## Available workspace deps on genesis
|
||||
|
||||
- `@suaveplan/network` ✅
|
||||
- `@suaveplan/error`, `@suaveplan/types`, `@suaveplan/events`, `@suaveplan/logger`, `@suaveplan/retry`, `@suaveplan/timing` ✅
|
||||
- `@suaveplan/testing` + `@suaveplan/testing-integration` ✅
|
||||
|
||||
- External: `gun`.
|
||||
|
||||
`package.json` declares `"engines": { "node": ">=20" }` and omits the `browser` field; server-tier marker comment in main entry point.
|
||||
|
||||
---
|
||||
|
||||
## Acceptance gate
|
||||
|
||||
1. `bunx turbo lint typecheck test --filter=@suaveplan/network-gundb-server` green.
|
||||
2. `bunx turbo test:coverage --filter=@suaveplan/network-gundb-server` 100/100/100/100.
|
||||
3. `bun run docs:check` green.
|
||||
4. Integration test boots the server in-process and exercises the client-server round trip.
|
||||
5. `STATUS.md` row flipped.
|
||||
|
||||
---
|
||||
|
||||
## Out of scope
|
||||
|
||||
- Production deployment infrastructure (Docker, k8s manifests, TLS termination) — deployment concern.
|
||||
- Cross-cluster federation across multiple server instances.
|
||||
Reference in New Issue
Block a user