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>
AX Principle 2 — comments show HOW with real values, not WHAT the
function does. The prose description restated the signature; replaced
with a concrete call sequence.
Co-Authored-By: Charon <charon@lethean.io>
Four type comments in mining.go restated the type name in prose
("represents a ...", "provides ..."), violating AX Principle 2.
Replaced with concrete usage examples showing realistic field values.
Co-Authored-By: Charon <charon@lethean.io>
AX principle 2: comments show HOW with real values, not WHAT the type
signature already states. Metrics and LatencyHistogram had prose
descriptions; replaced with concrete call-site examples.
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. "checks if an algorithm name contains only
valid characters" is a prose description — replaced with concrete call examples.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2 — comments must show HOW with real values, not restate WHAT
the type already says. WindowState, MinerDefaults and AppSettings all had
prose descriptions ("stores…") replaced with concrete call-site examples.
Co-Authored-By: Charon <charon@lethean.io>
Four internal methods had comments that restated prose descriptions
(e.g. "saves the autostart and last-used config for a miner") instead
of showing a concrete call site — violating AX Principle 2.
Replaced with usage-example comments showing realistic invocations with
argument values.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments show HOW via concrete call, not WHAT via prose.
The previous comment described the variable's purpose in prose — replaced
with a direct usage example showing the Get/Reset/Put pattern.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2 — comments show HOW with real values, not WHAT the
signature already says. "NewService creates a new mining service"
restates the name; the usage example teaches call-site shape.
Co-Authored-By: Charon <charon@lethean.io>
AX principle 2: comments show HOW with real values, not WHAT the signature says.
Removed five prose headers ("returns a mining config for...") that restated type
signatures. Retained concrete usage-example lines already present.
Co-Authored-By: Charon <charon@lethean.io>
Replace fmt.Errorf/Sprintf with package-native ErrInternal constructors
and strconv.Itoa for URL assembly in FetchJSONStats.
Co-Authored-By: Charon <charon@lethean.io>
Comments on GitHubRelease and fetchGitHubVersionDirect restated what
the type names already said. Replaced with concrete call examples
per AX Principle 2 (comments as usage examples).
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments must show usage examples, not restate what the
type signature already says. The line "ErrCircuitOpen is returned when
the circuit is open" adds zero information over the var declaration
itself. The usage example below it is kept.
Co-Authored-By: Charon <charon@lethean.io>
All test functions in circuit_breaker_test.go now follow the AX-required
naming pattern. Added missing _Bad and _Ugly variants and usage-example
comments on each test function.
Co-Authored-By: Charon <charon@lethean.io>
initDatabase and startDBCleanup had comments that restated the function
name in prose — violating AX Principle 2 (comments as usage examples).
Replaced with concrete call-site examples showing caller context.
Co-Authored-By: Charon <charon@lethean.io>
`mu` is an abbreviation requiring context to interpret; `mutex` is
self-describing and matches the AX rule that names must not require
a comment to explain.
Co-Authored-By: Charon <charon@lethean.io>
AX principle 2: comments show HOW with real values, not WHAT the
function name already says. "verifies if the miner is installed
correctly" restated the signature; replaced with a concrete call site.
Co-Authored-By: Charon <charon@lethean.io>