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>
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>
Replace fmt.Errorf with ErrInternal().WithCause() and
fmt.Sprintf URL with string concatenation + strconv.Itoa.
Co-Authored-By: Charon <charon@lethean.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
`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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
AX principle #2: comments must show HOW (concrete call), not describe
WHAT (which the signature already says).
Co-Authored-By: Charon <charon@lethean.io>
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>
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>