Commit graph

618 commits

Author SHA1 Message Date
Claude
53654cffbc
ax(node): replace prose type comments with usage examples in bundle.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
BundleType, Bundle, and BundleManifest had comments restating what the
type signature already says (AX Principle 2 violation). Replaced with
concrete usage examples showing how each type is constructed and used.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:13:16 +01:00
Claude
fe53e1fd4c
ax(mining): use predictable names in usage-example comments
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
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>
2026-04-02 16:12:46 +01:00
Claude
5a76b5c624
ax(node): replace banned path/filepath import with path in identity.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:11:32 +01:00
Claude
dfe3255abb
ax(mining): replace banned errors.New with ErrUnsupportedMiner in ttminer
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>
2026-04-02 16:11:30 +01:00
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
c9e39451f0
ax(node): replace prose comments with usage examples on debug log vars
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:09:43 +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
9945f2b031
ax(node): replace banned path/filepath import with path in worker.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
path/filepath is a banned import per AX conventions; path is the
correct alternative when core.JoinPath is not available in this repo.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:08:14 +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
dc2f415fc2
ax(node): rename ttl to timeToLive in MessageDeduplicator
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 1 — predictable names over short names.
The field `ttl` requires context to decode; `timeToLive` is
self-describing without a comment.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:37:36 +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
22c52c0b70
ax(node): replace prose comment with usage example on chain constants
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Failing after 32s
LetheanDefaults comment restated what the constant block name already says (AX
Principle 2). Replaced with concrete call examples showing GetChainInfo and
DiscoverPools usage against both daemon endpoints.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:35:46 +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
237a22e9a5
ax(node): rename single-letter variable u to parsedURL in CheckOrigin
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 variable `u`
in the WebSocket upgrader CheckOrigin closure required context to
understand; `parsedURL` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:33:43 +01:00
Claude
7901442c9b
ax(node): rename pr/pr1/pr2 to registry/firstRegistry/secondRegistry in peer_test.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. `pr` requires mapping to
PeerRegistry; `registry` is self-documenting on first read.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:32:21 +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
ea5996ce40
ax(node): rename ctx→cancelContext/requestContext/shutdownContext
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.
`ctx` is an abbreviation that requires prior knowledge to decode;
renamed to describe intent at each call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:28:07 +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
4d4ee5dd2a
ax(node): replace prose type comments with usage examples
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
AX Principle 2: comments show HOW with real values, not WHAT the
type signature already says. Converted 8 prose-style comments on
type declarations (Transport, TransportConfig, PeerConnection,
PeerRateLimiter, MessageDeduplicator, DisconnectPayload, NodeRole,
NodeIdentity, Peer) to concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:25:58 +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
225d5c0216
ax(ueps): use sharedSecret over short name secret in comment example
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 in TestPacket_MarshalAndSign_Ugly used `secret` (abbreviated)
where all other examples in the package consistently use `sharedSecret`.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:23:04 +01:00
Claude
906b2c9456
ax(node): rename abbreviated receiver names to full predictable names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace single-letter receivers (m *Message, e *ProtocolError) and
parameter (v interface{}) with full names (message, protocolError, target)
per AX Principle 1: predictable names over short names.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:22:52 +01:00
Claude
8b22e9dda6
ax(database): replace prose interface comments with usage examples
AX Principle 2: comments must show how to call the function with real
values, not restate what the type signature already says. All six
HashrateStore interface methods now carry concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:22:42 +01:00
Claude
44223f0c67
ax(logging): rename mu to mutex for predictable naming
AX Principle 1: abbreviated field names increase semantic ambiguity.
Logger.mu renamed to Logger.mutex — no comment required to understand it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:22:38 +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
2f75ac7c62
ax(node): replace prose PeerRegistry 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 prose that restates the type name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:21:29 +01:00
Claude
3b077dd00d
ax(logging): add missing function name to GetLevel doc comment
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:21:20 +01:00
Claude
d44cfa3790
ax(database): replace prose comment with usage example on GetAllMinerStats
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:21:17 +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
3ef84c6166
ax(ueps): guard tagValue index access against zero-length TLV values
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
A malformed frame with length 0 for any single-byte tag (TagVersion,
TagCurrentLayer, TagTargetLayer, TagIntent) or fewer than 2 bytes for
TagThreatScore caused a runtime panic (index out of range) on untrusted
input. Added len(tagValue) bounds checks in ReadAndVerify before each
tagValue[0] and Uint16 access to eliminate the panic path.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:20:39 +01:00
Claude
bac107b377
ax(database): rename TestInitialize_Disabled to TestDatabase_Initialize_Bad
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Test naming must follow TestFilename_Function_{Good,Bad,Ugly}. The disabled
path test was named freeform, breaking the mandatory pattern. Renamed to
TestDatabase_Initialize_Bad so it joins the existing TestDatabase_Initialize_Good
and forms a correctly named pair.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:20:08 +01:00
Claude
653db6563f
ax(node): replace prose comment on MinerManager with usage example
AX Principle 2 — comments show HOW with real values, not prose descriptions.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:20:03 +01:00
Claude
cb07aa01e3
ax(logging): replace prose comment with usage example on GetLevel
GetLevel had a comment that restated the signature in prose ("returns the
current minimum log level"), violating AX Principle 2. Replaced with a
concrete call-site example showing how the result is actually used.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:20:03 +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
8d323f7570
ax(logging): rename TestLoggerLevels/TestLoggerDebugLevel to TestFilename_Function_{Good,Bad,Ugly}
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
AX test naming rule: TestFilename_Function_{Good,Bad,Ugly} — all three
categories mandatory. Splits the single test into the three required forms.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:19:05 +01:00
Claude
2bfa958cfa
ax(database): replace prose comment with usage example on isInitialized
AX Principle 2: comments show HOW with real values, not restate what
the signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:19:01 +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
d0b37bf57f
ax(node): rename resp to response in controller.go
AX Principle 1 — predictable names over short names.
`resp` is an abbreviation that requires context to interpret;
`response` is self-describing at any reading distance.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:18:01 +01:00
Claude
1670659bba
ax(logging): replace prose comment on GetLevel with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
"GetLevel returns the current log level" restates the signature —
exactly what AX Principle 2 says to delete. Replaced with a concrete
usage example showing how a caller would inspect and conditionally
adjust the level.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:17:50 +01:00
Claude
8a23b0efca
ax(database): add usage-example comment to GetHashrateStats
GetHashrateStats had no comment at all — bare exported function.
AX Principle 2 requires comments as usage examples, not prose.

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