Commit graph

276 commits

Author SHA1 Message Date
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
Claude
49175d8f5b
ax(mining): replace prose comment on BaseMiner with usage example
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:18:10 +01:00
Claude
4afc61cbbb
ax(mining): rename cfg to configuration in DatabaseConfig field comments
AX Principle 1: predictable names over short names.
Usage-example comments inside DatabaseConfig used the abbreviation
cfg; renamed to configuration so the inline examples teach the full,
unambiguous name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:16:17 +01:00
Claude
089da5fc21
ax(mining): replace prose comment with usage example on parseVersion
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 (which the signature already says).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:14:41 +01:00
Claude
a86811220e
ax(mining): rename abbreviated locals nm/pr to nodeManager/peerRegistry in NewNodeService
Some checks failed
Security Scan / security (push) Successful in 28s
Test / test (push) Has been cancelled
AX Principle 1: predictable names over short names. nm and pr require
mental mapping to understand their purpose; nodeManager and peerRegistry
are self-documenting at the call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:13:17 +01:00
Claude
9076b77596
ax(mining): replace prose comments with usage examples on HTTP client accessors
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 2: comments that restate the signature add zero information.
Show a concrete call with realistic values instead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:11:58 +01:00
Claude
71292ccdc8
ax(mining): remove banned errors import from errors_test.go
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Replace errors.New() with ErrInternal()/ErrTimeout() and errors.Unwrap(err)
with err.Unwrap() — the MiningError type provides both without the banned import.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:10:49 +01:00
Claude
3e2f8f9f15
ax(mining): replace prose comment on ServiceStartup with usage example
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
AX Principle 2 — comments show HOW with real values, not describe WHAT
the function signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:09:37 +01:00
Claude
679a3c2177
ax(mining): replace prose comment on LogBuffer 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 type name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:08:10 +01:00
Claude
07281659da
ax(mining): replace prose comment with usage example on ReduceHashrateHistory
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 concrete values, not restate
what the signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:06:30 +01:00
Claude
fac2563aa2
ax(mining): replace prose comment with usage example on ShutdownTimeout
AX Principle 2 — comments as usage examples, not prose descriptions.
The previous comment restated what the constant name already communicates.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:05:00 +01:00
Claude
8ce93adf11
ax(mining): rename Container.mu to mutex (AX Principle 1)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
`mu` is an abbreviation that requires context to understand. AX Principle 1
mandates predictable names over short names — `mutex` is unambiguous.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:03:42 +01:00
Claude
0fe74ae8a6
ax(mining): replace pm abbreviation with profileManager in usage-example comments
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
AX Principle 1 (predictable names over short names): usage-example comments
in profile_manager.go used the abbreviated `pm` receiver throughout, while all
production code uses the full `profileManager` name. Comments are teaching
material — agents and readers learn from them. Aligning examples with the actual
variable name removes the abbreviation mapping overhead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:02:17 +01:00
Claude
a97f93b919
ax(mining): replace banned errors import with domain error constructors
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
xmrig_stats.go and ttminer_stats.go used errors.New() despite the
package providing ErrMinerNotRunning() and ErrInternal() for exactly
these cases. Removes banned errors import from both files.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:00:08 +01:00
Claude
7a121b7d18
ax(mining): rename mu to mutex in BaseMiner and LogBuffer (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 13:59:06 +01:00
Claude
0ffae0c646
ax(mining): rename configMu to configMutex in config_manager (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 13:57:26 +01:00
Claude
6149d7b283
ax(mining): rename mu to mutex in EventHub for AX Principle 1 compliance
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Abbreviated field name `mu` replaced with `mutex` throughout EventHub
to satisfy the predictable-names-over-short-names rule (RFC-025 §1).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:55:00 +01:00
Claude
ee8b3e6499
ax(mining): rename receiver s to supervisor on TaskSupervisor (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 13:50:53 +01:00
Claude
b55b2dd945
ax(mining): replace prose comment on Stop with usage example
AX Principle 2 — comments show HOW with real values, not WHAT the
signature already says. "Stop gracefully stops the service" restates
the name; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:48:45 +01:00
Claude
889636fff4
ax(mining): replace prose comments with usage examples in manager_test.go
AX Principle 2: comments must show HOW with real values, not restate
the function name. Four prose comments replaced with concrete call
examples showing inputs and expected outcomes.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:47:00 +01:00
Claude
af8f82f95a
ax(mining): rename mu to mutex in FileRepository (AX Principle 1)
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:40:56 +01:00
Claude
ecad4f5555
ax(mining): add usage example comments to MiningError builder methods
WithCause, WithDetails, WithSuggestion, IsRetryable, and StatusCode were
exported methods with no comment — violating AX Principle 2 (comments as
usage examples).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:39:31 +01:00
Claude
28cbd4491b
ax(mining): rename pm receiver to profileManager in profile_manager.go
AX Principle 1 — predictable names over short names. The receiver `pm`
requires knowledge of the type to decode; `profileManager` is
self-describing at every call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:36:41 +01:00
Claude
d65a1995be
ax(mining): rename mu to mutex in SupervisedTask and TaskSupervisor
AX Principle 1: predictable names over short names. The field `mu` is an
abbreviation that requires context to understand; `mutex` is self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:32:42 +01:00
Claude
ee8e6e1299
ax(mining): replace prose comments with usage examples in miner_factory
Two Principle 2 violations: globalFactory had a description comment instead
of a usage example, and registerDefaults restated the function name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:30:49 +01:00
Claude
db80ce6dde
ax(mining): rename wg to waitGroup in circuit breaker concurrency test
AX Principle 1: predictable names over short names. wg requires
mental mapping to WaitGroup; waitGroup is self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:27:05 +01:00
Claude
b62c757ed7
ax(mining): replace prose comment on Uninstall with usage example
AX principle #2: comments must show HOW (concrete call), not describe
WHAT (which the signature already says).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:24:34 +01:00
Claude
908f3f795b
ax(mining): replace prose comment on Service type with usage example
AX Principle 2: comments show HOW with real values, not WHAT the type is.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:20:46 +01:00
Claude
876d818216
ax(mining): replace prose comment with usage example on WriteStdin
AX Principle 2: comments show HOW with real values, not what the
signature already says. Replace description with call example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:17:30 +01:00
Claude
5de656ff04
ax(mining): replace prose type comments with usage examples in mining_profile.go
RawConfig and MiningProfile had description-style comments restating what
the types are rather than showing how to use them (AX Principle 2 violation).
Replaced with concrete call-site examples demonstrating real usage patterns.

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