Commit graph

5 commits

Author SHA1 Message Date
Claude
09f6f12f08
ax(node): fix TestProtocol_ValidateResponse_Ugly comment and assertion
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
ValidateResponse wraps type-mismatch in *ProtocolError (correct behaviour).
The docstring example showed the wrong negation and the assertion fired on
every run. Both the comment (AX §2 — comments as accurate usage examples)
and the guard were inverted; corrected to !IsProtocolError.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:56:38 +01:00
Claude
f086c767ab
ax(node): rename protocol_test.go functions to TestFilename_Function_{Good,Bad,Ugly}
All test functions now follow the mandatory AX test naming convention.
TestResponseHandler_ValidateResponse, TestResponseHandler_ParseResponse,
TestProtocolError, and TestGetProtocolErrorCode_NonProtocolError renamed
and restructured into Good/Bad/Ugly triplets.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:56:35 +01:00
Claude
92e8da2843
ax(node): rename TestConvenienceFunctions to AX-compliant TestProtocol_DefaultHandler_Good
TestConvenienceFunctions violated AX Principle 1 (predictable names — "ConvenienceFunctions"
is a vague label, not a description of what is tested) and Principle 10 (test naming must
follow TestFilename_Function_{Good,Bad,Ugly}).

Renamed to TestProtocol_DefaultHandler_Good, added a usage-example doc comment per
Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:35:17 +01:00
Claude
b0dcb18d76
ax(node): remove banned fmt import from protocol_test.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace fmt.Errorf with a local testErr type to eliminate the banned
fmt import. The type carries its own usage example comment per AX
Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:22:25 +01:00
snider
34f860309f refactor: Add reliability fixes and architecture improvements
Reliability fixes:
- Fix HTTP response body drainage in xmrig, ttminer, miner
- Fix database init race condition (nil before close)
- Fix empty minerType bug in P2P StartMinerPayload
- Add context timeout to InsertHashratePoint (5s default)

Architecture improvements:
- Extract HashrateStore interface with DefaultStore/NopStore
- Create ServiceContainer for centralized initialization
- Extract protocol response handler (ValidateResponse, ParseResponse)
- Create generic FileRepository[T] with atomic writes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 12:43:46 +00:00