Snider
ca04a88e35
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:16 +00:00
Snider
fe6667f1b1
chore: bump go directive to 1.26.0
...
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 20:34:57 +00:00
Claude
f80166251b
feat(levin): connection with framed TCP packet I/O
...
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 19:29:41 +00:00
Claude
101ef37985
feat(levin): portable storage section encode/decode
...
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 19:27:31 +00:00
Claude
abc88f5c7a
feat(levin): portable storage varint encode/decode
...
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 19:23:28 +00:00
Claude
7089e0990c
feat(levin): header encode/decode (33-byte Levin packet framing)
...
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 19:23:24 +00:00
Snider
712fe326ff
docs: add README with quick start and docs links
...
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 15:11:19 +00:00
Snider
6cf51fe8b0
Merge remote-tracking branch 'origin/main'
...
# Conflicts:
# FINDINGS.md
# TODO.md
2026-02-20 15:02:56 +00:00
Snider
3dd204705a
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
3ce0ce0455
docs: mark Phase 5 complete in TODO.md with commit hash
...
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 11:53:57 +00:00
Claude
bf4ea4b215
test: add Phase 5 integration tests, benchmarks, and bufpool tests
...
- Full integration test: two nodes on localhost exercising identity
creation, handshake, encrypted message exchange, UEPS packet routing
via dispatcher, and graceful shutdown
- Benchmarks: identity key generation, ECDH shared secret derivation,
KD-tree peer scoring (10/100/1000 peers), message serialisation,
SMSG encrypt/decrypt, challenge-response, UEPS marshal/unmarshal
- bufpool.go tests: buffer reuse verification, oversized buffer
discard, concurrent access, MarshalJSON correctness and safety
- Coverage: node/ 72.1% -> 87.5%, ueps/ 88.5% -> 93.1%
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 11:53:26 +00:00
Snider
c437fb3246
test: Phase 5 — integration tests, benchmarks, bufpool tests
...
- Integration: two-node localhost handshake + encrypted message exchange
+ controller ping/pong + UEPS packet routing via dispatcher + threat
circuit breaker + graceful shutdown (3 test functions)
- Benchmarks: 13 benchmarks across node/ and ueps/ — identity keygen,
ECDH shared secret, message serialise, SMSG encrypt/decrypt, HMAC
challenge sign/verify, KD-tree peer scoring, UEPS marshal/unmarshal,
bufpool throughput, challenge generation
- bufpool: 9 tests — get/put round-trip, buffer reuse, large buffer
eviction, concurrent access (race-safe), buffer independence,
MarshalJSON correctness + concurrency
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 06:09:21 +00:00
Claude
1ded31f61b
test(ueps): cover writeTLV error paths and ReadAndVerify edge cases
...
Push coverage from 88.5% to 93.1% by testing:
- writeTLV failures at each Write call (tag, length, value)
- ReadAndVerify io.ReadAll failure after 0xFF tag
- writeTLV and ReadAndVerify now at 100% function coverage
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 03:13:42 +00:00
Claude
ac70d879a1
test(node): push coverage from 72.4% to 87.4%
...
Add comprehensive tests for previously uncovered controller, worker,
peer, bundle, transport, identity and message functions:
- Controller: StartRemoteMiner, StopRemoteMiner, GetRemoteLogs (0% -> 80%+),
ConnectToPeer success path, handleResponse edge cases, PingPeer no-identity
- Worker: handleStartMiner with config/profile/errors (9% -> 91%),
handleStopMiner success/failure (20% -> 90%), handleGetLogs with
limits/not-found (14% -> 93%), handleDeploy miner/full bundles (24% -> 89%),
HandleMessage unknown type and integration via WebSocket, handleGetStats
with miner manager and no-identity
- Peer: safeKeyPrefix all branches (40% -> 100%), validatePeerName direct,
scheduleSave timer firing (35% -> 94%), saveNow/Close dirty data,
edge cases for Record*/Update*/Select* with non-existent peers
- Bundle: extractTarball path traversal/symlink/directory/empty,
ExtractMinerBundle checksum mismatch, CreateMinerBundle errors,
ReadBundle invalid JSON, StreamBundle empty bundle
- Transport: Broadcast with sender exclusion (0% -> 83%), Start/Stop
lifecycle (0% -> 83%), CheckOrigin validation, ConnectedPeers
- Identity: DeriveSharedSecret/GetIdentity without identity, Delete no files
- Message: nil payload, ParsePayload nil, NewErrorMessage
Co-Authored-By: Charon <charon@lethean.io>
2026-02-20 02:33:54 +00:00
Claude
276445515e
docs: mark Phase 4 complete in TODO.md and FINDINGS.md
...
Update task checklist with commit a60dfdf , resolve known issues #1 and
#5 (dispatcher stub and threat score semantics), add Phase 4 design
decisions to FINDINGS.md.
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 00:24:57 +00:00
Claude
a60dfdf93b
feat: implement UEPS packet dispatcher with threat circuit breaker
...
Implements Phase 4 of the go-p2p task queue. The Dispatcher routes
HMAC-verified UEPS packets to registered IntentHandlers by IntentID,
enforcing a threat circuit breaker that drops packets with ThreatScore
exceeding 50,000 (logged as threat events at WARN level).
Design choices:
- IntentHandler is a func type (not interface) for lightweight registration
- 1:1 mapping of IntentID to handler, replacement on re-register
- Threat check fires before intent routing (hostile packets never reach handlers)
- Sentinel errors (ErrThreatScoreExceeded, ErrUnknownIntent, ErrNilPacket)
- RWMutex protects handler map for concurrent safety
Tests: 10 test functions, 17 subtests — 100% dispatcher coverage.
Race detector clean. All 102 existing tests continue to pass.
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 00:23:10 +00:00
Claude
de36ce991a
docs: mark Phase 3 complete in TODO.md with commit hash
...
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 00:17:45 +00:00
Claude
33eda7b656
test: add controller tests (Phase 3) — node/ coverage 63.5% to 72.1%
...
14 tests covering request-response correlation, timeout handling,
auto-connect, parallel stat collection, ping RTT with metrics update,
concurrent multi-peer requests, and dead peer channel cleanup.
Also fixes a pre-existing data race (P2P-RACE-1) in GracefulClose where
SetWriteDeadline was called outside writeMu, racing with concurrent
Send() calls.
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 00:17:31 +00:00
Claude
62935bc515
docs: mark Phase 1-2 complete in TODO.md
...
UEPS: 88.5% coverage (2bc53ba )
Transport: node/ 42% → 63.5% (3ee5553 )
Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 00:10:36 +00:00
Claude
3ee5553d18
test: add transport layer tests (Phase 2) — node/ coverage 42% to 63.5%
...
13 tests covering all Phase 2 TODO items: reusable test pair helper,
full handshake with challenge-response verification, protocol version
rejection, allowlist rejection, SMSG encrypted message round-trip,
message deduplication, rate limiting (100 burst verified), MaxConns
enforcement, keepalive timeout cleanup, graceful disconnect, and
concurrent sends with race detection clean.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 00:08:35 +00:00
Claude
2bc53bac61
test: add UEPS wire protocol tests (Phase 1) — 0% to 88.5% coverage
...
25 subtests covering all 9 TODO items: round-trip, HMAC tampering
(payload + header), wrong shared secret, empty payload, ThreatScore
uint16 boundary, missing HMAC tag, TLV overflow, truncated packets,
and unknown tag handling. Also adds KB wiki docs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-19 23:44:09 +00:00
Claude
6d71da4065
docs: restructure TODO.md with phased task queue
...
Phase 1 (UEPS tests) → Phase 2 (transport) → Phase 3 (controller)
→ Phase 4 (dispatcher) → Phase 5 (integration/benchmarks)
Known issues and wiki inconsistencies documented.
Co-Authored-By: Charon <developers@lethean.io>
2026-02-19 23:29:36 +00:00
Snider
c9ac361f63
docs: assign to Linux homelab agent with platform-specific tasks
...
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 19:40:19 +00:00
Snider
cba084acde
docs: add CLAUDE.md, TODO.md, and FINDINGS.md for expert session
...
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 17:42:52 +00:00
Snider
9df1d523c1
docs: add session brief for expert agent work
...
Coverage gaps (UEPS 0%, transport 0%, controller 0%),
priority work items, and architecture map for guided
Claude session on test coverage and dispatcher implementation.
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 17:39:03 +00:00
Claude
8f94639ec9
feat: extract P2P networking and UEPS protocol from Mining repo
...
P2P node layer (peer discovery, WebSocket transport, message protocol,
worker pool, identity management) and Unified Ethical Protocol Stack
(TLV packet builder with HMAC-signed frames).
Ported from github.com/Snider/Mining/pkg/{node,ueps,logging}
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-16 15:47:10 +00:00