Snider
21fb545772
chore: add Go repo norms (badges, contributing, lint, taskfile, editorconfig)
...
Security Scan / security (push) Successful in 11s
Test / test (push) Successful in 39s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 06:45:51 +00:00
Snider
3d6f14cd91
feat: modernise to Go 1.26 iterators and stdlib helpers
...
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 3m49s
Add AllClients, AllChannels, AllSubscriptions iter.Seq iterators.
Use slices.Collect(maps.Keys()) in SendToChannel/Subscriptions,
range-over-int in calculateBackoff and benchmarks.
Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 05:32:08 +00:00
Claude
c942931657
ci: add Forgejo Actions test and security scan workflows
...
Test / test (push) Failing after 37s
Security Scan / security (push) Failing after 13m2s
Uses reusable workflows from core/go-devops for Go testing
(with race detector and coverage) and security scanning
(govulncheck, gitleaks, trivy).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 03:28:08 +00:00
Claude
f63c73b488
chore: sync workspace dependency versions
...
Run go work sync to align dependency versions across workspace.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:42:04 +00:00
Snider
41a677407c
refactor: apply go fix modernizers for Go 1.26
...
Automated fixes: interface{} → any, range-over-int, t.Context(),
wg.Go(), strings.SplitSeq, strings.Builder, slices.Contains,
maps helpers, min/max builtins.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 21:00:17 +00:00
Snider
ab793cd658
chore: bump go directive to 1.26.0
...
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 20:33:48 +00:00
Snider
effc1cde1c
docs: add README with quick start and docs links
...
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:11:20 +00:00
Snider
23aa979271
Merge remote-tracking branch 'origin/main'
...
# Conflicts:
# CLAUDE.md
# FINDINGS.md
2026-02-20 15:03:08 +00:00
Snider
5ccb169342
docs: graduate TODO/FINDINGS into production documentation
...
Replace internal task tracking (TODO.md, FINDINGS.md) with structured
documentation in docs/. Trim CLAUDE.md to agent instructions only.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:01:55 +00:00
Claude
ce342a1866
feat(ws): add authentication on WebSocket upgrade
...
Phase 2: Authenticator interface, BearerTokenAuth, QueryTokenAuth.
Reject unauthenticated connections before upgrade.
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:34:57 +00:00
Snider
da3df0077d
feat(redis): add Redis pub/sub bridge for multi-instance Hub coordination
...
RedisBridge enables multiple Hub instances to coordinate broadcasts
and channel-targeted messages across processes via Redis pub/sub.
Uses envelope pattern with sourceID for infinite loop prevention.
Phase 3 items 1-2 complete. 15 tests including cross-bridge
messaging, loop prevention, concurrent publishes, and graceful
shutdown. Race-free under -race.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 11:23:37 +00:00
Snider
9e48f0b60d
feat(auth): Phase 2 — token-based authentication on WebSocket upgrade
...
Add Authenticator interface with AuthenticatorFunc adapter and built-in
APIKeyAuthenticator for Bearer token validation. Hub.Handler() now gates
connections when an Authenticator is configured on HubConfig, responding
HTTP 401 for failed auth. Client.UserID and Client.Claims are populated
on successful upgrade. OnAuthFailure callback enables logging/metrics.
Nil authenticator preserves full backward compatibility — all existing
tests pass unchanged. 18 new tests (unit + integration) cover valid/
invalid/missing/malformed headers, func adapter, multi-client auth,
message delivery post-auth, and the OnAuthFailure callback.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 08:12:45 +00:00
Snider
534bbe571f
docs: flesh out Phase 2 auth task specs
...
Detail Authenticator interface, APIKeyAuthenticator built-in,
HubConfig integration (nil = backward compat), Client auth fields,
OnAuthFailure callback, and full test matrix with integration tests.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 07:56:35 +00:00
Snider
53d8a15544
test: expand Phase 0 coverage — 16 new tests, 9 benchmarks, SPDX headers
...
Add 16 additional test functions covering Hub.Run lifecycle (register,
broadcast delivery, unregister, duplicate unregister), Subscribe/
Unsubscribe channel management (multiple channels, idempotent, partial
leave), SendToChannel with multiple subscribers, SendProcessOutput/
SendProcessStatus edge cases (no subscribers, non-zero exit), readPump
ping timestamp verification, writePump batch message delivery, and
integration tests (unsubscribe stops delivery, broadcast reaches all,
disconnect cleans up everything, concurrent broadcast+subscribe).
Add ws_bench_test.go with 9 comprehensive benchmarks using b.Loop()
(Go 1.25+) and b.ReportAllocs(): broadcast (100 clients), channel send
(50 subscribers), parallel variants, message marshalling, WebSocket
end-to-end round-trip, subscribe/unsubscribe cycle, multi-channel
fanout, and concurrent subscriber registration.
Add SPDX-Licence-Identifier headers to ws.go, ws_test.go, ws_bench_test.go.
go vet clean, go test -race clean, 66 tests + 11 benchmarks total.
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 05:14:11 +00:00
Claude
13d9422b74
feat(ws): phase 0 coverage (98.5%) + phase 1 connection resilience
...
Phase 0: Fix SendToChannel data race (client map iterated outside lock),
add 16 test functions covering all edge cases, benchmarks, and integration
tests. Coverage 88.4% -> 98.5%. go vet clean, race detector clean.
Phase 1: Add HubConfig with configurable heartbeat/pong/write timeouts
and OnConnect/OnDisconnect callbacks. Add ReconnectingClient with
exponential backoff, max retries, and OnConnect/OnDisconnect/OnReconnect
state callbacks. Full test coverage for all resilience features.
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 01:17:56 +00:00
Snider
51f9c59fab
docs: enrich TODO.md with Phase 0 hardening tasks
...
Add Phase 0: Hub lifecycle tests, channel management, client
pump tests, integration test with httptest, broadcast benchmarks.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 00:28:49 +00:00
Virgil
5618c5879f
docs: add TODO.md and FINDINGS.md for fleet delegation
...
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 21:36:25 +00:00
Snider
e9425004e2
feat: extract go-ws from core/go pkg/ws
...
WebSocket hub with channel-based pub/sub. Zero internal dependencies.
Module: forge.lthn.ai/core/go-ws
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 16:08:52 +00:00