Commit graph

773 commits

Author SHA1 Message Date
Claude
abd4335935
ax(mining): replace prose comment with usage example on respondWithMiningError
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments show HOW with real values, not WHAT the function does.
"sends a structured error response" restates the signature; replaced with
two concrete call-site examples showing realistic arguments.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:37:20 +01:00
Claude
acef50ad62
ax(node): rename tt loop variable to testCase in lethean_test.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle #1 — predictable names over short names. The `tt` loop variable
is a two-letter abbreviation with no defined exception in the AX naming rules
(only `i`, `_`, `t`, `c` are acceptable short names). Renamed to `testCase`
throughout TestParseComment_{Good,Bad,Ugly}.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:36:41 +01:00
Claude
00025dd324
ax(mining): remove prose description comments from circuit_breaker_test
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments must show usage examples, not restate what the
function name already conveys. Deleted 13 redundant "verifies that..."
lines; kept only the concrete usage-example lines below each.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:35:50 +01:00
Claude
676d7b13a9
ax(node): remove prose description lines from PeerRegistry method comments
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments show usage examples, not prose descriptions.
Five methods (AddPeer, UpdatePeer, RemovePeer, UpdateMetrics, UpdateScore)
had a redundant "Note: Persistence is debounced..." prose line appended
after the usage example. The usage example already communicates intent;
the prose line restated implementation detail without adding value.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:33:20 +01:00
Claude
9933c8e5aa
ax(mining): replace prose comments with usage examples in service.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments show HOW with real values, not restate what
the type signature already says. Three prose-style doc comments on
DefaultRequestTimeout, HealthResponse, and StdinInput replaced with
concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:33:00 +01:00
Claude
b0c1d0e05c
ax(mining): replace banned encoding/json import in lethean.go with project-native MarshalJSON
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Use the package-local MarshalJSON helper (bufpool.go) instead of calling
json.Marshal directly, eliminating the banned encoding/json import per AX conventions.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:31:42 +01:00
Claude
81f4fc9d96
ax(node): replace prose constant comments with usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Score constants had comments restating the name in prose
("Increment for successful interaction") rather than showing
how they are used. AX Principle 2: comments are usage examples,
not descriptions.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:31:11 +01:00
Claude
10dd88281b
ax(mining): remove banned fmt import from simulated_miner.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace fmt.Errorf with typed MiningError constructors (ErrMinerExists,
ErrMinerNotRunning) and fmt.Sprintf log lines with string concatenation
using strconv, eliminating the banned fmt import per AX conventions.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:30:03 +01:00
Claude
152952e101
ax(node): rename allowedPublicKeyMutex to allowedPublicKeysMutex
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Mutex name was singular (allowedPublicKeyMutex) while the field it
protects is plural (allowedPublicKeys). AX Principle 1 requires
predictable names — the mutex name must mirror the field it guards.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:29:43 +01:00
Claude
4d1695a50c
ax(mining): replace prose comment with usage example on containsShellChars
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle 2: comments must show usage with concrete values, not restate
the function name in prose. The leading description line was deleted;
the two call-site examples that follow are sufficient.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:27:46 +01:00
Claude
e06f8de589
ax(node): rename buf to buffer in bundle_test for predictable naming
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1 — predictable names over short names. `buf` is an
abbreviation that requires a comment to understand; `buffer` is
self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:26:37 +01:00
Claude
8bfb425fda
ax(mining): replace prose comment with usage example on isRetryableError
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle 2: comments show HOW with real values, not WHAT the
function does — the signature already says that.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:25:43 +01:00
Claude
8fe169aeb6
ax(node): replace prose comment with usage example on bufferPool
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
RFC-025 Principle 2: comments must show HOW with real values, not
restate what the variable does in prose.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:24:39 +01:00
Claude
1518ddd0d8
ax(mining): replace banned strings import in manager.go with local helpers
Removes the banned "strings" import from manager.go by introducing two
package-local helpers — equalFold and hasPrefix — backed by bytes.EqualFold
and slice comparison respectively.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:24:28 +01:00
Claude
58701498ea
ax(node): rename w/r HTTP handler params to responseWriter/request
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter parameter names w and r violate AX Principle 1
(predictable names over short names). Only i, _, t, and c are
permitted as single-letter names per the AX spec.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:23:25 +01:00
Claude
62d27a8da3
ax(mining): replace prose comments with usage examples in xmrig.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
GetLatestVersion, Install, and Uninstall had prose comments restating
their signatures; replaced with concrete call-site examples per AX
principle 2 (comments as usage examples, not descriptions).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:22:20 +01:00
Claude
e263fe7f1e
ax(node): rename loop variable p to peer in peer_test.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1 — Predictable names over short names.
The single-letter `p` in `for _, p := range peers` is not listed
in the allowed exceptions (only `i`, `_`, `t`, `c` are permitted).
Rename to `peer` for semantic clarity.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:21:34 +01:00
Claude
cdf9525afd
ax(mining): replace prose comments with usage examples in service.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments must show a concrete call, not describe behaviour.
Three functions had prose descriptions ("controls whether...", "filters
potentially sensitive...", "sends a structured error response") — replaced
with usage-example comments showing realistic call sites.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:20:40 +01:00
Claude
39ebb63eac
ax(node): replace prose comment with usage example on peerNamePattern
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments show HOW with real values, not WHAT the code does.
The old comment restated the variable name; the new comment shows concrete
validatePeerName calls that demonstrate valid and invalid inputs.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:19:45 +01:00
Claude
7a5c54c36f
ax(mining): rename abbreviated mu field to mutex in LatencyHistogram
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle 1: predictable names over short names. The mu field
abbreviation requires the reader to infer it means sync.Mutex.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:19:13 +01:00
Claude
956f8de643
ax(node): replace prose comment with usage example in NewController
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX-2: comments must show concrete usage, not restate what the code does.
The "Register message handler for responses" prose comment was replaced
with a usage-example comment that shows the actual call pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:18:23 +01:00
Claude
a96af6adb2
ax(mining): replace banned fmt.Errorf with project-native error constructors in profile_manager
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Removes the banned `fmt` import from profile_manager.go. All four
fmt.Errorf calls are replaced with ErrInternal/ErrProfileNotFound,
consistent with the error pattern used throughout the rest of the
mining package.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:17:33 +01:00
Claude
cdeb66b82d
ax(node): rename pe to protocolError in GetProtocolErrorCode
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1: pe is an abbreviation requiring a comment to explain.
Renamed to protocolError throughout, including the usage example comment.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:16:44 +01:00
Claude
4638a34ffa
ax(mining): rename minLen to minimumLength in compareVersions
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle 1 — predictable names over short names.
`minLen` requires inference; `minimumLength` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:16:07 +01:00
Claude
d5d60d39e1
ax(node): rename ChainInfo.Aliases to AliasCount for type clarity
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The field Aliases int was ambiguous — agents and readers expect Aliases
to be a slice, not a count. AliasCount makes the int type self-evident
without requiring a comment (AX Principle 1: predictable names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:15:07 +01:00
Claude
8e1dffe649
ax(mining): replace prose comment with usage example on GetStats
AX Principle 2: comments must show HOW with real values, not restate
the type signature. "GetStats retrieves the performance statistics from
the running XMRig miner." added zero information beyond the name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:14:50 +01:00
Claude
2cccc32375
ax(mining): fix test naming and comment style in dual_mining_test.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Rename flat test functions to TestFilename_Function_{Good,Bad,Ugly} pattern
and replace prose description comments with usage-example comments per AX
principles 1 and 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:13:48 +01:00
Claude
53654cffbc
ax(node): replace prose type comments with usage examples in bundle.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
BundleType, Bundle, and BundleManifest had comments restating what the
type signature already says (AX Principle 2 violation). Replaced with
concrete usage examples showing how each type is constructed and used.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:13:16 +01:00
Claude
fe53e1fd4c
ax(mining): use predictable names in usage-example comments
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter variables v, c, d in GetVersion/GetCommit/GetBuildDate
comments violated AX Principle 1 (predictable names over short names).
Replaced with versionString, commitHash, buildDate.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:12:46 +01:00
Claude
5a76b5c624
ax(node): replace banned path/filepath import with path in identity.go
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 16:11:32 +01:00
Claude
dfe3255abb
ax(mining): replace banned errors.New with ErrUnsupportedMiner in ttminer
Remove the banned `errors` import from ttminer.go. The single call
to errors.New is replaced with the existing ErrUnsupportedMiner
constructor from errors.go, which carries the OS name, HTTP status,
and a details note about CUDA requirements.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:11:30 +01:00
Claude
b6a2fb626e
ax(mining): replace banned strings import with unicode in miner_factory.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Remove the banned "strings" import from miner_factory.go. Replace all
strings.ToLower calls with a package-level toLowerASCII helper that uses
unicode.ToLower per rune, matching the pattern used in other files.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:10:02 +01:00
Claude
c9e39451f0
ax(node): replace prose comments with usage examples on debug log vars
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:09:43 +01:00
Claude
c91752af2f
ax(mining): rename mu to mutex in SimulatedMiner
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1: predictable names over short names. mu → mutex
matches the same fix already applied to Manager and SettingsManager.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:08:32 +01:00
Claude
9945f2b031
ax(node): replace banned path/filepath import with path in worker.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
path/filepath is a banned import per AX conventions; path is the
correct alternative when core.JoinPath is not available in this repo.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:08:14 +01:00
Claude
7111c16533
ax(mining): remove banned fmt import from settings_manager.go
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 16:05:34 +01:00
Claude
44bbe42141
ax(mining): remove banned fmt import from repository.go
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 16:05:14 +01:00
Claude
fb1d4f74e2
ax(mining): remove banned fmt import from config_manager.go
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 16:04:52 +01:00
Claude
427f0e9fad
ax(mining): remove banned fmt import from file_utils.go
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 16:04:07 +01:00
Claude
b41084eafe
ax(mining): remove banned fmt import from version.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace fmt.Errorf with ErrInternal().WithCause() and
fmt.Sprintf URL with string concatenation + strconv.Itoa.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:02:08 +01:00
Claude
1edbd19f25
ax(mining): rename cb to circuitBreaker in FetchLatestGitHubVersion
Some checks failed
Security Scan / security (push) Failing after 23s
Test / test (push) Failing after 6m57s
AX Principle 1 — predictable names over short names. The local variable
`cb` requires mental mapping; `circuitBreaker` names the value directly.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:38:03 +01:00
Claude
dc2f415fc2
ax(node): rename ttl to timeToLive in MessageDeduplicator
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 1 — predictable names over short names.
The field `ttl` requires context to decode; `timeToLive` is
self-describing without a comment.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:37:36 +01:00
Claude
67ecffed94
ax(mining): replace prose comment with usage example on InstallationDetails
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments that restate the type signature add zero
information. Replaced with a concrete call site showing how to
obtain and inspect the struct.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:36:49 +01:00
Claude
22c52c0b70
ax(node): replace prose comment with usage example on chain constants
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Failing after 32s
LetheanDefaults comment restated what the constant block name already says (AX
Principle 2). Replaced with concrete call examples showing GetChainInfo and
DiscoverPools usage against both daemon endpoints.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:35:46 +01:00
Claude
be137e61c5
ax(mining): replace APIError prose comment with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Failing after 23s
AX principle 2 — comments must show HOW with real values, not restate
what the type declaration already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:35:13 +01:00
Claude
8b00af67d7
ax(mining): replace banned fmt import with MiningError in container.go
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
container.go used fmt.Errorf for all error construction, violating the
AX banned-imports rule. Replaced with ErrInternal().WithCause() using
the package's own error primitives, consistent with the rest of pkg/mining.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:33:59 +01:00
Claude
237a22e9a5
ax(node): rename single-letter variable u to parsedURL in CheckOrigin
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1: predictable names over short names. The variable `u`
in the WebSocket upgrader CheckOrigin closure required context to
understand; `parsedURL` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:33:43 +01:00
Claude
7901442c9b
ax(node): rename pr/pr1/pr2 to registry/firstRegistry/secondRegistry in peer_test.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1 — predictable names over short names. `pr` requires mapping to
PeerRegistry; `registry` is self-documenting on first read.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:32:21 +01:00
Claude
3a7c918dc8
ax(mining): rename s to settings in AppSettings lambda parameters
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1 — predictable names over short names.
All Update() callback closures used `s *AppSettings`; renamed to
`settings *AppSettings` throughout, including the usage-example comment.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:32:00 +01:00
Claude
fda7c2019c
ax(mining): replace prose comment with usage example on NodeService struct
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments must show HOW with real values, not restate what
the type name already says. Replace the description-style comment with a
concrete two-line call sequence showing construction and route registration.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:30:15 +01:00