Commit graph

336 commits

Author SHA1 Message Date
Claude
f0b4fea2e3
ax(mining): replace prose comment with usage example on addCliArgs
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 signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:48:46 +01:00
Claude
e560e93ef3
ax(mining): rename EventHub receiver from h to hub for AX Principle 1 compliance
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter receiver `h` on all EventHub methods is a predictability
violation — `hub` carries semantic meaning across the file.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:47:22 +01:00
Claude
9da561ae95
ax(mining): rename minersMu to minersMutex in wsClient
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 abbreviated
field minersMu was missed when the EventHub mu was renamed to mutex
in a prior sweep.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:45:32 +01:00
Claude
d10faee13d
ax(mining): replace banned fmt.Errorf with package error constructors in miner.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Remove `fmt` import from miner.go; replace all fmt.Errorf calls with
ErrInstallFailed, ErrInternal, and ErrMinerNotFound using .WithCause/.WithDetails.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:44:08 +01:00
Claude
45722a230c
ax(mining): rename da receiver to digestAuth and ha1/ha2 to hashA1/hashA2 in auth.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 two-character
receiver `da` on DigestAuth methods mirrors the `cb` → `circuitBreaker`
fix already applied. The local variables `ha1` and `ha2` (RFC 2617 hash
computation steps) are renamed to `hashA1` and `hashA2` for the same reason.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:41:38 +01:00
Claude
852db44e4e
ax(mining): replace prose comment with usage examples in error code block
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 block contains.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:39:58 +01:00
Claude
b20b74fbe7
ax(mining): replace prose comment with usage example on MinerTypeTTMiner
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 name means.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:38:42 +01:00
Claude
263b45db88
ax(mining): rename cb receiver to circuitBreaker in CircuitBreaker methods
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 receiver abbreviation
`cb` required mapping overhead — replaced with the full `circuitBreaker` name
across all eight methods in circuit_breaker.go.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:37:00 +01:00
Claude
fc79b16f67
ax(mining): replace prose doc comment with usage example on XMRigMiner.Stop
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 signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:34:18 +01:00
Claude
0c2802a882
ax(mining): replace prose comment on wsUpgrader with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments must show HOW (concrete call), not describe WHAT.
The wsUpgrader var comment restated the variable's purpose in prose; replaced
with a usage example showing the Upgrade call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:33:04 +01:00
Claude
ccf57565b9
ax(mining): replace prose comments with usage examples on xmrig.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 WHAT
the signature already says. Replaced two prose description blocks
on MinerTypeXMRig and getXMRigConfigPath with concrete call examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:31:27 +01:00
Claude
39f0a57847
ax(mining): replace fmt.Sprintf with string concatenation in miner.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Two uses of the banned fmt import used fmt.Sprintf for trivial string
concatenation (timestamp prefix in LogBuffer.Write, XDG path in GetPath).
Replaced with direct string concatenation per AX banned-import rules.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:29:57 +01:00
Claude
f4c7a91603
ax(mining): replace banned strings import in node_service with package-local containsStr
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Adds containsStr alongside existing equalFold/hasPrefix string helpers in manager.go,
then removes the banned "strings" import from node_service.go.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:27:29 +01:00
Claude
14019e9693
ax(mining): rename httpClientMu to httpClientMutex (AX Principle 1)
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 17:24:46 +01:00
Claude
7e66f32ee5
ax(mining): rename rl receiver to limiter in RateLimiter methods
AX Principle 1 — predictable names over short names. `rl` requires
mental decoding; `limiter` is self-documenting at the call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:23:02 +01:00
Claude
42fd76d0c2
ax(mining): remove banned encoding/json import from stats_collector.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace json.NewDecoder streaming decode with io.ReadAll + the package's
own UnmarshalJSON wrapper (bufpool.go), eliminating the direct encoding/json
dependency in line with AX banned-import rules.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:20:57 +01:00
Claude
5832752616
ax(mining): replace prose description with usage example on DefaultMetrics
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 name already says.
"DefaultMetrics is the global metrics instance" restates the declaration.
Replace with concrete field access examples an agent can copy directly.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:19:00 +01:00
Claude
d3ae8ce8e7
ax(mining): rename abbreviated tr to tarReader in untar
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. tr requires
the reader to know tar conventions; tarReader is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:18:01 +01:00
Claude
e0b941cf05
ax(mining): replace fmt.Errorf with ErrInternal in updateInstallationCache
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Four fmt.Errorf calls in updateInstallationCache used the banned fmt
package for error construction. Replaced with ErrInternal().WithCause()
to match the established pattern used throughout the package. Also
replaced the prose comment with a usage example per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:16:27 +01:00
Claude
9e5afb3d69
ax(mining): rename abbreviated parameter st to supervisedTask in startTask
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 parameter `st`
required a mental mapping to `*SupervisedTask`; `supervisedTask` is
self-documenting at every call site inside the function.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:15:01 +01:00
Claude
ab4c764f3f
ax(mining): replace prose comments with usage examples in repository.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Three comments violated AX Principle 2 (comments as usage examples):
- Repository interface comment described what it was rather than showing usage
- FileRepositoryOption comment said "configures a FileRepository" (restates the type)
- saveUnlocked comment described behaviour rather than showing the call pattern

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:13:36 +01:00
Claude
8406c0b4f2
ax(mining): replace prose comment with usage example on createConfig
AX Principle 2: comments show HOW with real values, not WHAT the
signature already says. The previous comment restated the function
name in prose; now it shows a concrete call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:11:53 +01:00
Claude
f6884ddad6
ax(mining): replace prose description comments with usage examples in ttminer.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Comments on TTMiner, TTMinerSummary, and getTTMinerConfigPath restated
what the type signature already said. Replace with concrete call examples
per AX Principle 2 (Comments as Usage Examples).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:10:45 +01:00
Claude
ec0ab317ea
ax(mining): replace prose comment with usage example on XMRigMiner
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 type is.
The old comment restated the struct definition. Replaced with a concrete
construction example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:08:47 +01:00
Claude
bc7b752754
ax(mining): replace prose comment with usage example on TTMiner.GetStats
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
signature already says. Aligns with xmrig_stats.go and simulated_miner.go.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:07:57 +01:00
Claude
2508b03df1
ax(mining): replace encoding/json with internal UnmarshalJSON in version.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Remove banned `encoding/json` import from pkg/mining/version.go; read
response body with io.ReadAll then decode via the package-local
UnmarshalJSON wrapper (bufpool.go). Also complete the partial fmt
removal in pkg/node/identity.go left broken by the previous sweep.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:07:00 +01:00
Claude
23cab1fc95
ax(mining): replace prose comments with usage examples on unzip/untar
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
signature already says. "unzip extracts a zip archive" restates the
name; replaced with concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:03:29 +01:00
Claude
3b3f20684e
ax(mining): remove banned fmt import from auth.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace fmt.Sprintf calls with string concatenation (+) and
strconv.FormatInt for integer formatting. fmt is a banned import
per AX conventions; all string formatting goes through Core primitives
or native concatenation.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:02:04 +01:00
Claude
d514d4956d
ax(mining): replace prose comment with usage example on NodeInfoResponse
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
// Node Info Response restated the type name — deleted per AX Principle 2.
Replaced with a concrete usage example showing all fields populated.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:00:27 +01:00
Claude
5728c73496
ax(mining): replace banned errors.New() with package-native MiningError constructors
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
errors.New() is a banned import. xmrig_start.go now uses ErrMinerExists()
and ErrInvalidConfig() from the package's own MiningError system, removing
the "errors" import entirely.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:59:11 +01:00
Claude
5687999f4f
ax(mining): replace prose comment with usage example on TTMiner.Start
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:58:02 +01:00
Claude
7b098da3be
ax(mining): replace prose comments with usage examples in simulated_miner.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle 2 — comments must show HOW (concrete call), not restate WHAT
the name already says. Three prose-style descriptions replaced with
realistic usage examples showing struct construction and registration.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:56:59 +01:00
Claude
1e5af44364
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
Three middleware helper functions had comments that restated the function
name in prose (AX principle 2 violation). Replaced with concrete call-site
examples showing how each middleware is installed and what it does.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:55:07 +01:00
Claude
670401c750
ax(mining): replace prose comments with usage examples on middleware funcs
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
securityHeadersMiddleware and contentTypeValidationMiddleware had comments
that restated the signature in prose — AX Principle 2 requires usage
examples showing how the function is called, not descriptions of what it does.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:52:31 +01:00
Claude
f78be454e4
ax(mining): replace prose DTO comments with usage examples in node_service.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Eight struct type comments restated what the name already said (AX Principle 2
violation). Replaced all with concrete HTTP request/response examples showing
actual field values, so agents can learn call shape from context alone.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:50:55 +01:00
Claude
d798248ed8
ax(mining): replace prose comment with usage example on logWithRequestID
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 name already says. Prose description deleted; two concrete
call-site examples added.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:49:16 +01:00
Claude
871dc781f1
ax(mining): replace prose GetType 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 16:48:10 +01:00
Claude
d8dffa398b
ax(mining): replace prose field comments with usage examples in ContainerConfig
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
ContainerConfig had five "X is the Y" prose field comments that restated
the type signature (AX §2 violation). Container had three section-divider
labels ("Core services", "Database store", "Initialization state") that
describe what is self-evident from the field names. Both patterns are
explicitly banned — delete prose, show usage.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:47:16 +01:00
Claude
82781c6f95
ax(mining): remove prose comment that restates constant name
LetheanTestnetPool is self-documenting; the prose description
"is the default pool endpoint for testnet mining" adds zero
information over the name. Per AX principle 2, deleted and kept
only the usage example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:44:39 +01:00
Claude
3c9ff897f2
ax(mining): replace prose comments with usage examples on TTMiner methods
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:42:43 +01:00
Claude
dd9f5cfcaf
ax(mining): replace banned errors.New with ErrUnsupportedMiner in xmrig.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The `errors` package is banned; all errors must use the package's own
error constructors. Replace `errors.New("unsupported operating system")`
with `ErrUnsupportedMiner(runtime.GOOS)` which also surfaces the actual
OS name in the error message.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:41:15 +01:00
Claude
f71d551cdd
ax(mining): replace banned errors import in ttminer_start.go with project-native constructors
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace errors.New() calls with ErrMinerExists() and ErrInvalidConfig() from the
project's own errors.go, removing the banned errors import (AX banned imports rule).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:39:53 +01:00
Claude
7d5074bf3b
ax(mining): replace prose comment on requestTimeoutMiddleware with usage example
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.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:38:52 +01:00
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
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
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
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
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
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