Commit graph

481 commits

Author SHA1 Message Date
Claude
a84d999984
ax(ueps): replace fictional sentinel example with concrete package sentinel
AX Principle 2 — comments must show realistic usage with actual values from
the codebase, not placeholder examples. The sentinelError type comment used
errNotFound (a fictional variable) instead of errTLVValueTooLarge (the actual
sentinel declared on the next line).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:09:47 +01:00
Claude
8d1e007d69
ax(node): rename errMsg to errorMessage in Worker.HandleMessage
AX Principle 1 — predictable names over short names. errMsg is an
abbreviation that requires a comment to explain; errorMessage is
self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:09:22 +01:00
Claude
9f0df5e86e
ax(mining): replace prose struct comments with usage examples in metrics.go
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>
2026-04-02 13:08:54 +01:00
Claude
00d0e5ed96
ax(ueps): replace variable placeholder with concrete value in writeTLV usage comment
AX Principle 2 requires comments to show concrete usage with realistic values.
The writeTLV comment used `intentID` (a variable name) as a placeholder
rather than a real value; replaced with `0x01` and added error-capture
pattern to show the full call site shape.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:07:53 +01:00
Claude
e08d475c13
ax(node): expand abbreviated loop variable in DiscoverGateways usage example
Comment used `gw` (AX-1: predictable names over short names).
Expanded to `gateway` so the usage example matches what code should look like.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:07:40 +01:00
Claude
8247d62ab3
ax(mining): replace prose comment with usage example on isValidAlgo
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>
2026-04-02 13:06:48 +01:00
Claude
5b0b0d638e
ax(node): rename nm to nodeManager in worker_test.go (AX Principle 1)
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:05:57 +01:00
Claude
cc9cc33511
ax(mining): rename cfg to authConfig in auth_test.go
AX Principle 1 — predictable names over short names.
cfg abbreviates AuthConfig, requiring a mapping; authConfig
is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:05:33 +01:00
Claude
b8d7216905
ax(ueps): fix AX-2 violation in TestReader_ReadAndVerify_Bad — add errIntegrityViolation sentinel check
Comment described assertion in prose ("integrity violation" in error message) rather
than showing the concrete sentinel pattern. Test also failed to verify err identity
consistently with TestReader_ReadAndVerify_Ugly and packet_test.go error tests.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:04:43 +01:00
Claude
fedb0317bc
ax(mining): replace restatement comments on settings structs with usage examples
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>
2026-04-02 13:02:37 +01:00
Claude
11f19c41b1
ax(node): replace prose comment on NodeManager with usage example
NodeManager's type comment restated the name in prose ("handles node
identity operations") rather than showing concrete usage. Replaced with
a three-line example demonstrating construction, identity check, and
retrieval — per AX Principle 2 (Comments as Usage Examples).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:02:34 +01:00
Claude
bec37d0a84
ax(ueps): use var declaration for header in ReadAndVerify
Replaces `header := UEPSHeader{}` with `var header UEPSHeader` for
consistency with the surrounding zero-value var declarations in the
same block — predictable, uniform pattern over mixed init styles.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:02:14 +01:00
Claude
d98073caa6
ax(node): remove banned fmt import from protocol.go
Replace fmt.Sprintf/fmt.Errorf with strconv.Itoa and string
concatenation; surface fmt.Errorf error paths as typed
*ProtocolError values for consistent protocol error handling.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:00:55 +01:00
Claude
8e63d4d0bd
ax(mining): replace prose comments with usage examples in manager.go
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>
2026-04-02 13:00:23 +01:00
Claude
7abfc54b3f
ax(ueps): add usage-example comment to sentinelError.Error method
AX-2 — the Error() method on sentinelError had no comment; added a
concrete call-and-result example so an agent can understand the
sentinel identity contract without tracing the type definition.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:59:05 +01:00
Claude
f9b2a5dd75
ax(node): rename Worker receiver from w to worker
AX Principle 1 — predictable names over short names.
The single-letter receiver `w` is ambiguous; `worker` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:59:05 +01:00
Claude
ddb24545b9
ax(mining): replace prose comment with usage example on bufferPool
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>
2026-04-02 12:58:24 +01:00
Claude
f086c767ab
ax(node): rename protocol_test.go functions to TestFilename_Function_{Good,Bad,Ugly}
All test functions now follow the mandatory AX test naming convention.
TestResponseHandler_ValidateResponse, TestResponseHandler_ParseResponse,
TestProtocolError, and TestGetProtocolErrorCode_NonProtocolError renamed
and restructured into Good/Bad/Ugly triplets.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:56:35 +01:00
Claude
95712b5ad9
ax(mining): replace prose comment with usage example on XMRigMiner.Start
AX Principle 2: comments must show a concrete call, not restate the signature.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:56:05 +01:00
Claude
fdbfbabe87
ax(ueps): add usage-example comment to sentinelError type
sentinelError had no comment, violating AX Principle 2 (comments as
usage examples). Added a concrete call-site example showing sentinel
identity comparison pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:55:51 +01:00
Claude
cd8d17cc78
ax(node): expand ctrl receiver to controller in Controller methods
AX Principle 1 — predictable names over short names. `ctrl` is an
abbreviation that requires a comment to explain; `controller` is
self-documenting and consistent with the `manager` pattern used in
NodeManager and PeerRegistry receivers.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:54:19 +01:00
Claude
f0d988b980
ax(ueps): fix writeTLV comment to use frameBuffer matching actual callers
AX Principle 2: usage example comments must show realistic call sites.
The writeTLV header comments used `buffer` as the first argument name,
but the parameter is `writer` and all callers pass `frameBuffer`.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:53:25 +01:00
Claude
bbbe474610
ax(mining): replace prose comment on NewService with usage example
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>
2026-04-02 12:53:21 +01:00
Claude
222edcd070
ax(ueps): rename uepsError to sentinelError — redundant package prefix on private type
The type name uepsError used the package abbreviation as a prefix, which
adds no semantic value inside the ueps package and violates AX Principle 1
(predictable names over short names). sentinelError names what the type IS:
an immutable, comparable error value.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:50:34 +01:00
Claude
ca3faa0144
ax(node): rename channel to responseChannel in handleResponse
AX Principle 1 — predictable names over short names. The variable
`channel` in handleResponse required context to understand its role;
`responseChannel` is self-describing on first read.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:49:30 +01:00
Claude
511066b844
ax(mining): replace prose-description comments with usage examples in lethean.go
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>
2026-04-02 12:49:24 +01:00
Claude
0785f4fcf8
ax(ueps): rename packetError to uepsError for package-scoped clarity
The type was named packetError but also used in reader.go for reader-side
sentinel errors (errMissingHMAC, errIntegrityViolation). The name implied
packet-only scope, misleading agents reading reader.go. uepsError names the
type after the package it belongs to, matching AX principle 1.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:47:43 +01:00
Claude
d7df78af1f
ax(mining): remove banned fmt import from stats_collector
Replace fmt.Errorf/Sprintf with package-native ErrInternal constructors
and strconv.Itoa for URL assembly in FetchJSONStats.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:47:06 +01:00
Claude
2792db3919
ax(node): rename pending to pendingRequests for AX Principle 1 compliance
The field name `pending` required an inline comment to explain its
purpose ("message ID -> response channel"). Per AX Principle 1,
names that require a comment to explain are too short — rename to
`pendingRequests` so the field is self-describing without annotation.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:46:55 +01:00
Claude
83a4d9d07d
ax(node): replace prose comments with usage examples in transport and identity
AX Principle 2: comments must show HOW with real values, not restate what
the function name already says. Five prose descriptions replaced with
concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:43:23 +01:00
Claude
dc9d7d5041
ax(ueps): remove redundant comment restating code in default switch case
AX Principle 2 — comments must show usage examples, not restate what
the code already says. The inline comment in the default branch of
ReadAndVerify's tag-switch duplicated the three lines beneath it verbatim,
adding zero information.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:43:23 +01:00
Claude
ee69484f5f
ax(mining): replace prose comments with usage examples in version.go
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>
2026-04-02 12:43:09 +01:00
Claude
be4d388860
ax(ueps): fix inaccurate default-case comment in ReadAndVerify
Comment showed Write([]byte{...}) but code uses WriteByte — misleading
concrete example violates AX Principle 2 (comments as accurate usage examples).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:31:03 +01:00
Claude
836fc18ff3
ax(node): replace prose comments with usage examples (AX Principle 2)
Comments on saveNow, save, load, Close, and DefaultResponseHandler
restated what the signature already said. Replace with concrete call
examples showing how each is actually invoked.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:30:42 +01:00
Claude
e656a12da7
ax(mining): remove prose comment that restates the ErrCircuitOpen declaration
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>
2026-04-02 12:30:31 +01:00
Claude
c20670f062
ax(ueps): remove double-slash comment prefix violating AX Principle 2
Some checks failed
Test / test (push) Successful in 4m40s
Security Scan / security (push) Failing after 12m22s
Test doc-comments used `// //` to prefix expected-result lines, producing
comments-within-comments rather than clean usage examples. Strip the
redundant inner `//` so all lines read as plain code-example comments.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:25:45 +01:00
Claude
8a899153ed
ax(node): strip _WrongURL suffix from lethean test names
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
Test names must follow TestFilename_Function_{Good,Bad,Ugly}.
The extra _WrongURL qualifier broke the AX naming convention
(RFC-CORE-008 §10 — CLI tests as artifact validation).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:23:44 +01:00
Claude
4f3141beb8
ax(mining): replace prose comment with usage example on autostartMiners
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 12:22:53 +01:00
Claude
067a4c38f8
ax(ueps): rename signedData to hmacInputBuffer for predictable naming
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
signedData was ambiguous — it did not convey that the buffer holds
accumulated header TLVs fed as input to HMAC, nor whether data was
already signed or pending signing. hmacInputBuffer makes the purpose
unambiguous on first read (AX Principle 1: predictable names over
short names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:21:22 +01:00
Claude
99f37ed1bc
ax(mining): rename circuit_breaker_test.go to TestFilename_Function_{Good,Bad,Ugly} convention
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>
2026-04-02 12:20:58 +01:00
Claude
ee3fb3d6b7
ax(node): replace prose comment with usage example on rebuildKDTree
AX principle 2: comments show HOW (usage example), not WHAT
(which the function name already says).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:20:36 +01:00
Claude
cd1ca73885
ax(mining): replace prose comments with usage examples in events.go
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
Nine comments restated type/function names (AX Principle 2 violation).
Replaced with concrete call-site examples showing realistic usage.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:17:24 +01:00
Claude
c57462bd52
ax(node): replace prose struct comments with usage examples
AX Principle 2: comments must show HOW with real values, not restate
what the type signature already says. All payload struct comments in
message.go were prose descriptions ("HandshakePayload is sent during
connection establishment") — replaced with concrete construction
examples showing field usage.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:16:41 +01:00
Claude
0a30a45b7d
ax(ueps): add usage-example comments to exported tag constants
Some checks failed
Security Scan / security (push) Successful in 30s
Test / test (push) Has been cancelled
TagCurrentLayer, TagTargetLayer, TagIntent, and TagThreatScore were
exported constants with no comment, violating AX Principle 2 (comments
as usage examples). Each now has a concrete writeTLV call showing the
tag, value encoding, and valid range where relevant.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:13:50 +01:00
Claude
d812ad92de
ax(node): add Bad and Ugly test categories for TestIdentity_NodeManager
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 10 requires all three categories (Good, Bad, Ugly) per test
group. identity_test.go had TestIdentity_NodeManager_Good with no Bad or
Ugly counterparts. Adds error-path tests for non-writable paths and
uninitialised identity, plus edge cases for double-generation and
delete-before-generate.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:12:22 +01:00
Claude
15f45b9fbc
ax(mining): replace prose comments with usage examples in manager.go
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>
2026-04-02 12:11:56 +01:00
Claude
9a3179ac6b
ax(ueps): assert sentinel error identity in writeTLV_Bad test
All checks were successful
Security Scan / security (push) Successful in 37s
Test / test (push) Successful in 4m27s
Comment promised errTLVValueTooLarge but test only checked err != nil.
AX Principle 2 requires comments to be accurate usage examples —
the comment implied sentinel identity so the assertion must verify it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:05:04 +01:00
Claude
bd11abb7df
ax(node): replace prose constant comment with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
ChallengeSize comment restated the name ("is the size of the challenge
in bytes") — violating AX Principle 2. Replace with a concrete usage
example showing how the constant is used at call sites.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:04:30 +01:00
Claude
bde60612f1
ax(mining): rename CircuitBreaker.mu to mutex for AX Principle 1 compliance
`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>
2026-04-02 12:04:26 +01:00
Claude
b53e5f2b19
ax(mining): rename RateLimiter.mu to mutex; fix prose comment to usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1 (predictable names): `mu` abbreviates `mutex` — rename to `mutex`.
AX Principle 2 (comments as usage examples): struct doc was prose ("provides token
bucket rate limiting per IP address") — replace with concrete call examples.

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