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>
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>
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>