Commit graph

10 commits

Author SHA1 Message Date
Claude
906b2c9456
ax(node): rename abbreviated receiver names to full predictable names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace single-letter receivers (m *Message, e *ProtocolError) and
parameter (v interface{}) with full names (message, protocolError, target)
per AX Principle 1: predictable names over short names.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:22:52 +01:00
Claude
aa36675cfb
ax(node): rename receiver h to handler in ResponseHandler (AX Principle 1)
Single-letter receiver `h` requires mental mapping to understand it refers to
*ResponseHandler. Renamed to `handler` for self-documenting, predictable naming.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:33:02 +01:00
Claude
d98073caa6
ax(node): remove banned fmt import from protocol.go
Replace fmt.Sprintf/fmt.Errorf with strconv.Itoa and string
concatenation; surface fmt.Errorf error paths as typed
*ProtocolError values for consistent protocol error handling.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:00:55 +01:00
Claude
836fc18ff3
ax(node): replace prose comments with usage examples (AX Principle 2)
Comments on saveNow, save, load, Close, and DefaultResponseHandler
restated what the signature already said. Replace with concrete call
examples showing how each is actually invoked.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:30:42 +01:00
Claude
7a87f2e633
ax(node): replace prose comments with usage examples in protocol.go
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
ValidateResponse, ParseResponse, and GetProtocolErrorCode had comments
that restated the function signature in prose — violating AX Principle 2
which requires comments to show concrete call-site usage, not descriptions.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:28:54 +01:00
Claude
df8f17c1cb
ax(node): replace prose comment with usage example on ParseResponse
AX Principle 2 — comments show HOW with real values, not what the
signature already says. The previous comment restated the method name
as prose; replaced with a concrete call pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:34:58 +01:00
Claude
b18aa741ba
ax(node): replace prose comment with usage example on IsProtocolError
AX Principle 2 — comments show HOW with real values, not what the
signature already says. "returns true if the error is a ProtocolError"
restates the type; a concrete call pattern teaches agents how to use it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:37:09 +01:00
Claude
33659c311f
ax(node): replace prose comments with usage examples in protocol.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
ProtocolError and ResponseHandler had prose descriptions restating
their names — AX Principle 2 violation. Replaced with concrete call
examples showing how callers use each type.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:20:07 +01:00
Claude
873ccaee7b
ax(node): replace prose ValidateResponse comment with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:47:37 +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