Commit graph

305 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Claude
ac77e42b6a
ax(mining): remove prose comments from EventHub struct fields
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments that restate the field name add no information
and should be deleted. Replace DefaultMaxConnections prose description
with a usage example showing the override pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:28:59 +01:00
Claude
dbbc5c7d46
ax(mining): rename mu and eventHubMu to mutex and eventHubMutex in Manager
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 requires
knowledge of the convention to understand; mutex is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:27:23 +01:00
Claude
1892c3409a
ax(mining): replace prose description with usage example on compareVersions
AX principle 2: comments must show HOW with real values, not restate what
the type signature already says. The old comment described return values;
the new comment shows a concrete call with realistic version strings.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:25:51 +01:00
Claude
f242df27aa
ax(mining): replace description comments with usage examples on InitRouter and SetupRoutes
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 14:24:52 +01:00
Claude
ff7acab30e
ax(mining): replace prose comments with usage examples on writePump/readPump
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
RFC-025 §2: comments that restate what the function name already says
are deleted and replaced with concrete call-site examples showing
goroutine launch context and behaviour.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:23:36 +01:00
Claude
2eeaf47b3c
ax(mining): rename TestNewContainer and TestDefaultContainerConfig to follow TestFilename_Function_{Good,Bad,Ugly} convention
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 14:22:01 +01:00
Claude
0ad11f4199
ax(mining): add usage-example comments to MiningError.Error and Unwrap
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 prose.
Error() and Unwrap() were the only exported methods on MiningError
lacking usage example comments.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:21:01 +01:00
Claude
74ebda333d
ax(mining): rename mu to mutex in SettingsManager
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
AX Principle 1 — predictable names over short names. The mu field
requires context to understand; mutex is self-describing.

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