Commit graph

158 commits

Author SHA1 Message Date
Claude
f32bf6f3ba
ax(mining): replace prose comment on NewTaskSupervisor with usage example
AX Principle 2: comments show HOW with real values, not WHAT the
function name already says. All other constructors in the file already
use usage-example comments; NewTaskSupervisor was the outlier.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:00:10 +01:00
Claude
60997f79d2
ax(mining): replace prose comments with usage examples on BaseMiner methods
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
GetPath, GetBinaryPath, and Stop had comments that restated what the
signature already said. AX Principle 2: comments show HOW with real
values, not WHAT the type signature already declares.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:58:17 +01:00
Claude
ddfd62b8ce
ax(mining): replace prose comments with usage examples in settings_manager
Three comments restated the function/type name in prose (AX principle 2
violation). Replaced with concrete call-site examples showing real usage.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:56:40 +01:00
Claude
9664de2330
ax(mining): replace prose Config comment with usage example
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 30s
AX principle 2: comments must show usage with realistic values, not
restate what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:54:19 +01:00
Claude
e4144c5f48
ax(mining): replace prose comment with usage example on FetchLatestGitHubVersion
AX Principle 2: comments must show concrete usage, not restate the signature.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:51:39 +01:00
Claude
22d67f94c2
ax(mining): replace banned errors import with package error constructors in miner.go
Stop() and WriteStdin() used errors.New() (banned import) instead of the
package's own MiningError constructors. Replaced with ErrMinerNotRunning()
and ErrTimeout() which carry structured codes, HTTP status, and retry hints.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:50:43 +01:00
Claude
61c11cc0ee
ax(mining): replace prose comments with usage examples in events.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 WHAT the
signature already says. Converted all exported function/method prose
descriptions to concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:49:06 +01:00
Claude
cb44a640cb
ax(mining): rename abbreviated variables b and h to randomBytes and digest in auth.go
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. Single-letter variables
b (random byte buffer) and h (MD5 digest array) require mental mapping; full
names make intent self-evident without comments.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:46:32 +01:00
Claude
349f395cc6
ax(mining): replace banned encoding/json import in events.go with package wrapper
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
Add UnmarshalJSON wrapper to bufpool.go and route the json.Unmarshal
call in events.go readPump through the package-local wrapper, removing
the direct "encoding/json" import which is banned under AX RFC-025.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:44:40 +01:00
Claude
553f85ac60
ax(mining): rename ratelimiter tests to TestFilename_Function_{Good,Bad,Ugly} pattern
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. Test functions must
follow TestFilename_Function_{Good,Bad,Ugly} with all three categories.
Middleware coverage split across Good/Bad/Ugly; token-refill and stop tests
receive the mandatory suffixes. Comments updated to usage-example form (AX §2).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:43:12 +01:00
Claude
271f3c2580
ax(mining): replace prose comments with usage examples on BaseMiner history/log accessors
AX Principle 2 — comments show HOW with real values, not WHAT the signature already says.
GetHighResHistoryLength, GetLowResHistoryLength, and GetLogs all had comments that
restated the function name. Replaced with concrete call-site examples showing expected
return ranges and usage patterns.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:40:10 +01:00
Claude
76fb616ba9
ax(mining): replace prose comments with usage examples in node_service.go
AX principle 2 — comments must show concrete call-site usage, not restate
the function signature in prose. Four public method comments updated to
show how callers invoke them with realistic values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:37:23 +01:00
Claude
e3f017aa9b
ax(mining): remove banned strings import from mining.go
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
Replace strings.Contains in containsShellChars with a switch-on-rune
loop, matching the style of isValidAlgo already in the same file.
Also adds usage-example comments per AX principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:35:49 +01:00
Claude
822ac004ea
ax(mining): remove banned fmt import from manager.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace all fmt.Sprintf and fmt.Errorf calls with string concatenation
and the existing MiningError constructors (ErrMinerNotFound, ErrMinerExists,
ErrInvalidConfig, ErrInternal, ErrDatabaseError). Adds strconv for integer
formatting. No fmt import remains in the file.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:34:11 +01:00
Claude
fdc7064e09
ax(mining): replace prose comments with usage examples in container.go
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 2 — comments as usage examples, not prose descriptions.
NewContainer, Start, and Shutdown had comments restating the signature
("creates a new container", "begins all background services", etc.).
Replaced with concrete call examples showing how to invoke each function.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:31:10 +01:00
Claude
a862480862
ax(mining): replace prose comment on Stop with usage example
AX principle 2: comments show HOW with concrete usage, not WHAT
the signature already says. The old two-line prose comment restated
the function name verbatim; replaced with a defer call example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:29:25 +01:00
Claude
cc8eeab231
ax(mining): replace prose comments in auth.go with usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
All comments on AuthConfig, DefaultAuthConfig, AuthConfigFromEnv,
DigestAuth, NewDigestAuth, Stop, Middleware, and all private methods
were restating the type signature in prose. Replaced with concrete
call-site examples per AX Principle 2 (comments as usage examples).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:29:03 +01:00
Claude
d6c684df4c
ax(mining): replace prose comment on StopMiner 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
signature already says. Prose restating the method signature deleted;
concrete call examples with realistic miner names substituted.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:24:36 +01:00
Claude
865a690853
ax(mining): replace prose comment with usage example on RegisterMiner
AX Principle 2 — comments must show HOW with real values, not describe
WHAT the signature already states.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:23:12 +01:00
Claude
6010f02091
ax(mining): replace prose comments with usage examples in circuit_breaker.go
Three internal method comments restated what the function name already
expressed (AX Principle 2). Replaced with concrete call-site examples
that show how each method is used in context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:21:25 +01:00
Claude
0e6290f703
ax(mining): replace prose comment on SetEventHub with usage example
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 31s
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:19:01 +01:00
Claude
c39c9b9ff8
ax(mining): replace prose comments with usage examples on Container
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
AX Principle 2 — comments must show HOW with real values, not restate
what the type signature already says. The Container struct comment and
Initialize method comment both described what the code does in prose;
replaced with concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:17:40 +01:00
Claude
649f57e91e
ax(mining): replace prose comment on StartMiner with usage example
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 signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:15:55 +01:00
Claude
b4dc3e6948
ax(mining): replace prose comment on NewManagerForSimulation with usage example
AX Principle 2: comments must show HOW with real values, not restate what
the type signature already says. Replaced description prose with a concrete
call pattern showing ctx + Config.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:13:26 +01:00
Claude
301a5428b0
ax(mining): replace prose comment with usage example on findAvailablePort
AX Principle 2 — comments must show HOW with real values, not restate
what the function name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:11:24 +01:00
Claude
8e9f18ac3e
ax(mining): replace prose struct comment with usage example on CircuitBreaker
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 already says in its name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:08:29 +01:00
Claude
cc829d1bc8
ax(mining): rename wg to waitGroup in collectMinerStats
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. `wg` requires
domain knowledge to decode; `waitGroup` is self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:06:48 +01:00
Claude
1ad014e71c
ax(mining): replace prose comments with usage examples in repository.go
Three comments on Path, Exists, and Delete restated what the signatures
already convey. Replaced with concrete call examples per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:04:34 +01:00
Claude
599603e2f4
ax(mining): replace prose comment with usage example on FetchJSONStats
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. The old comment restated the function's
prose description; replaced with a concrete call site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:03:17 +01:00
Claude
7d7dfce6ea
ax(mining): replace prose comment with usage example on instanceNameRegex
AX Principle 2: comments show HOW with real values, not WHAT the name
already says. The old comment restated the variable name; the new comment
shows a concrete ReplaceAllString call with input and expected output.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:01:20 +01:00
Claude
5610491832
ax(mining): replace prose field comments on CircuitBreakerConfig with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
RFC-CORE-008 §2: comments that restate type signatures add zero information.
Replace the five prose comments (type-level + three field-level) with a single
concrete construction example showing real values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:59:01 +01:00
Claude
0c6c84d4c6
ax(mining): replace prose comment with usage example on startTask
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. "startTask starts a single supervised task."
adds zero information — replaced with a concrete call site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:57:18 +01:00
Claude
2b2b89f158
ax(mining): replace NewManager prose comment 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
signature already says. Replace "creates a new miner manager" prose
with a concrete call-site example showing manager lifecycle.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:56:15 +01:00
Claude
0c7546650a
ax(mining): replace prose comment with usage example on ListMiners
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 08:54:33 +01:00
Claude
6ec5639265
ax(mining): replace banned fmt import with ErrInvalidConfig in Config.Validate
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Remove the banned `fmt` import from mining.go; all fmt.Errorf calls in
Config.Validate replaced with the existing ErrInvalidConfig helper which
returns a structured *MiningError — consistent with the package error model.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:52:52 +01:00
Claude
6c0534a325
ax(mining): rename l to listener in findAvailablePort
Single-letter variable `l` violates AX Principle 1 (predictable names
over short names) — renamed to `listener` to match the semantic intent.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:50:23 +01:00
Claude
11a3af4b1b
ax(mining): replace prose comment with usage example on GetMiner
RFC-CORE-008 Principle 2 — comments must show HOW with real values,
not restate what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:48:13 +01:00
Claude
caa887325d
ax(mining): rename cfg to configuration in circuit_breaker_test.go
AX Principle 1 — predictable names over short names. `cfg` requires
context to decode; `configuration` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:47:09 +01:00
Claude
ae80737a41
ax(mining): replace prose comments with usage examples on LoadMinersConfig/SaveMinersConfig
Some checks failed
Security Scan / security (push) Successful in 30s
Test / test (push) Has been cancelled
AX Principle 2: comments as usage examples. Both functions had prose descriptions
that restated the signature ("loads the miners configuration from the file system").
Replace with concrete call-site examples that show how to use the return value.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:45:14 +01:00
Claude
565dae709d
ax(mining): replace banned errors import with ErrInternal in mining_profile.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
RawConfig.UnmarshalJSON used errors.New() (banned import) despite the
package already providing ErrInternal() for exactly this purpose.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:42:39 +01:00
Claude
03d326a97e
ax(mining): remove banned fmt import from errors.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace fmt.Sprintf calls with string concatenation throughout
all MiningError constructors and the Error() method.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:40:59 +01:00
Claude
afbccd42f4
ax(mining): replace prose comment with usage example on Config.Validate
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. The previous comment restated the return
type contract; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:38:01 +01:00
Claude
66bb37326b
ax(mining): replace prose comments with usage examples on GetType/GetName
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. "GetType returns the miner type identifier" restates the
signature — replace with concrete call examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:35:47 +01:00
Claude
ed76d53b85
ax(mining): replace prose comment with usage example on LogBuffer.Clear
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments must show usage, not restate the signature.
"Clear clears the log buffer." adds zero information beyond the name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:34:13 +01:00
Claude
58e1c23f0c
ax(ueps): replace prose threat comment with error-handling 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 08:33:58 +01:00
Claude
0432d23a63
ax(mining): rename cfg to configuration in circuit breaker usage comment
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 usage example
comment used the banned abbreviation `cfg` — replaced with `configuration`.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:32:21 +01:00
Claude
50548447fd
ax(mining): replace prose comment with usage example on recordSuccess
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 function name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:31:04 +01:00
Claude
d122682387
ax(mining): replace signature-restating comments with usage examples in version.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
GetVersion/GetCommit/GetBuildDate comments restated the signature verbatim.
Replaced with concrete call examples showing realistic return values per AX-2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:30:02 +01:00
Claude
588e6447bb
ax(mining): replace prose Execute comment 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
signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:28:45 +01:00
Claude
6704ac781c
ax(mining): replace prose comments with usage examples in settings_manager.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Seven setter/getter comments restated the function signature rather than
showing a concrete call (AX Principle 2). Replaced all with real invocation
examples so agents know exactly how to call each method.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:26:55 +01:00