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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>