Commit graph

11 commits

Author SHA1 Message Date
Claude
2a5a3d6393
ax(node): add missing Bad and Ugly test variants for HandlePing
AX Principle 10 requires all three categories (Good, Bad, Ugly) for
every test function. TestWorker_HandlePing had only Good; add Bad
(invalid payload) and Ugly (zero SentAt edge case).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:58:46 +01:00
Claude
4990e78156
ax(node): rename worker_test.go functions to Good/Bad/Ugly convention
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
Test function names lacked the required {Good,Bad,Ugly} suffix mandated
by AX Principle 10. Renamed HandlePing and HandleGetStats (missing suffix),
and _NoManager/_Profile/_UnknownType variants to _Bad/_Bad/_Ugly.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:09:20 +01:00
Claude
985fc78c40
ax(node): rename TestWorker_SetProfileManager to include _Good suffix
AX Principle 10 requires test functions follow TestFilename_Function_{Good,Bad,Ugly}
naming. TestWorker_SetProfileManager was missing the mandatory category suffix.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:07:07 +01:00
Claude
0074577210
ax(node): rename pr to peerRegistry in worker_test.go
AX-1 (Predictable Names): the local variable `pr` is an abbreviation
that requires context to decode. Renamed to `peerRegistry` across all
test functions so the type is self-evident at the point of use.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:06:24 +01:00
Claude
9a38c8d547
ax(node): add _Good suffix to TestWorker_SetMinerManager per AX-10 test naming
AX-10 requires test functions follow TestFilename_Function_{Good,Bad,Ugly}.
TestWorker_SetMinerManager tested only the happy path with no suffix.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:56:33 +01:00
Claude
017d386c6d
ax(node): fix test name to follow TestFilename_Function_Good convention
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestConvertMinerStats did not follow the AX Principle 10 test naming
convention (TestFilename_Function_{Good,Bad,Ugly}). Renamed to
TestWorker_ConvertMinerStats_Good to match the required pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:29:26 +01:00
Claude
fbdb14e98f
ax(node): rename TestNewWorker to follow AX test naming convention
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle requires TestFilename_Function_{Good,Bad,Ugly}.
TestNewWorker → TestWorker_NewWorker_Good.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:48:41 +01:00
google-labs-jules[bot]
1f464a62f1 Implement STIM bundle decryption and installation
- Updated `Worker.handleDeploy` to handle STIM bundles using `ExtractProfileBundle` and `ExtractMinerBundle`.
- Used `PeerConnection.SharedSecret` as the password for decryption.
- Implemented logic for `BundleProfile`, `BundleMiner`, and `BundleFull`.
- Fixed broken files `pkg/node/dispatcher.go` and `pkg/node/peer.go` to ensure compilation and testing.
- Updated tests in `pkg/node/worker_test.go` and added coverage for deployment logic.
2026-02-02 06:07:05 +00: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
snider
d61a8aff8b refactor: Remove unused code and fix nil dereference issues
- Remove unused exported functions from pkg/database (session tracking,
  bulk hashrate inserts, various query helpers)
- Remove unused exported functions from pkg/node (identity management,
  bundle operations, controller methods)
- Make internal-only functions unexported in config_manager.go and database.go
- Remove unused EventProfile* constants from events.go
- Add GetCommit() and GetBuildDate() to expose version.go variables
- Fix potential nil dereference issues flagged by Qodana:
  - Add nil checks for GetIdentity() in controller.go, transport.go, worker.go
  - Add nil checks for GetPeer() in peer_test.go
  - Add nil checks in worker_test.go

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-31 09:24:12 +00:00
snider
e0c9c92244 feat: Implement logging functionality for miners with log buffer and retrieval endpoint 2025-12-29 22:10:45 +00:00