Expose a Since-aware remote log helper on the controller and plumb the filter through the worker's miner log lookup so the payload field is honoured end-to-end.
Co-Authored-By: Virgil <virgil@lethean.io>
Update go.mod module line from forge.lthn.ai/core/go-p2p to
dappco.re/go/core/p2p. Migrate core dependency paths: go-log to
dappco.re/go/core/log v0.1.0, go-io to dappco.re/go/core/io v0.2.0.
Update all .go import paths across 18 source files. Borg, Poindexter,
and Enchantrix dependencies remain on forge.lthn.ai as they have not
been migrated upstream.
Co-Authored-By: Virgil <virgil@lethean.io>
The coreio abstraction hardcodes file permissions (0644) and has no
OpenFile equivalent. os.OpenFile is needed here to preserve tar header
mode bits — executable binaries require 0755.
Co-Authored-By: Virgil <virgil@lethean.io>
Add coreerr.E() and coreio.Local conventions to CLAUDE.md coding
standards. Wrap two raw os.OpenFile/io.Copy errors in extractTarball
with coreerr.E for consistent error context.
Coverage: logging 86%, node 86%, levin 87%, ueps 92%.
No fmt.Errorf or os.ReadFile/os.WriteFile in production code.
Co-Authored-By: Virgil <virgil@lethean.io>
Replace all fmt.Errorf and errors.New in production code with
coreerr.E("caller.Method", "message", err) from go-log. Replace
os.ReadFile/os.WriteFile/os.MkdirAll/os.Remove with coreio.Local
equivalents from go-io. Test files left untouched.
Co-Authored-By: Virgil <virgil@lethean.io>
Update Borg, Poindexter, and Enchantrix dependency paths from
github.com/Snider/ to forge.lthn.ai/Snider/ across go.mod and imports.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
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>