v0.1.0-alpha.2: /events + KPI avanzate + E2E + idle-timeout + fix ESM
Delta da alpha.1
WS /events endpoint
- WebSocket
/eventsintegrato nel daemon (ku + health + ack) - Token bucket backpressure (10 msg/s, burst 20)
- Idle timeout WS (5 min) + ping/pong per client inattivi
- ACK immediato incrementa
metrics.net.acked
Metrics avanzate
- Prometheus exposition:
/metrics?format=prom - Nuove metriche:
sgn_net_delivered/acked/dedup_ratio,sgn_ws_clients,sgn_events_drop - Istogrammi con p50/p95 per latenza HTTP
- CI smoke: artifact
prom.txtautomatico
E2E tests robusti
events-minimal-e2e: publish → WS ku → ack → metricsevents-slow-client-e2e: client lento, health continua, no loss KUmetrics-*-e2e: contatori/quantili/Prometheus- Anti-race:
waitForHealth()+ path assoluti
VSCode extension
- Subscription automatica a
/events - Toast "KU ricevuta" con bottoni Open/Verify
- Settings:
sgn.eventsPath(default/events) - README con troubleshooting e esempi
Fix & hardening
- Fix ESM:
require()→statSyncin sqlite-real-storage - Log
daemon_listenper readiness - Cleanup processi child nei test
Pilot ready
Quick start:
npm run daemon:start
wscat -c ws://localhost:8787/events # vedi health + ku
curl -s http://localhost:8787/metrics?format=promKPI da monitorare:
- Delivery:
sgn_net_acked / sgn_net_delivered ≈ 1.0 - Latenza:
sgn_http_publish_p50 < 200ms, p95 < 1s - Stabilità:
sgn_events_drop ≈ 0
Pilot setup:
trust.json: modewarnper 24h → poienforce- VSCode extension: toast real-time su KU
- CI: KU-receipt on test fail
Vedi README_PILOT.md per setup completo.