Commit graph

513 commits

Author SHA1 Message Date
Claude
45da2e4e88
ax(ueps): fix writeTLV comment to match actual parameter name
Comment examples used 'buffer' but the parameter is named 'writer' —
the example was not a valid call site. AX Principle 2 requires comments
to show concrete, accurate usage with real values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:38:31 +01:00
Claude
af7070f27a
ax(node): rename receiver d to deduplicator on MessageDeduplicator
Single-letter receiver `d` violates AX Principle 1 (predictable names
over short names). RFC-CORE-008 permits single-letter receivers only for
`i` (range loops), `_` (discards), `t` (tests), and `c` (*core.Core).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:38:25 +01:00
Claude
7664917fc2
ax(ueps): group related var declarations into a single block
Four separate var statements in ReadAndVerify consolidated into a
var () block — more declarative and AX principle #5 compliant.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:37:05 +01:00
Claude
ac3c869684
ax(node): replace prose comment on MessageHandler with usage example
AX Principle 2: comments show HOW with real values, not WHAT the type does.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:36:58 +01:00
Claude
28cbd4491b
ax(mining): rename pm receiver to profileManager in profile_manager.go
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>
2026-04-02 13:36:41 +01:00
Claude
37bd7b8855
ax(ueps): replace placeholder name with concrete value in errTLVValueTooLarge comment
AX Principle 2: comments must show HOW with real values, not placeholder names.
`oversized` is a non-executable placeholder; `bytes.Repeat([]byte("x"), 256)` is
the concrete call that produces the error, matching the example already used in
the writeTLV body comment.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:35:03 +01:00
Claude
aa36675cfb
ax(node): rename receiver h to handler in ResponseHandler (AX Principle 1)
Single-letter receiver `h` requires mental mapping to understand it refers to
*ResponseHandler. Renamed to `handler` for self-documenting, predictable naming.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:33:02 +01:00
Claude
d65a1995be
ax(mining): rename mu to mutex in SupervisedTask and TaskSupervisor
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>
2026-04-02 13:32:42 +01:00
Claude
1c1b2cadf1
ax(node): rename Transport.conns to connections for AX Principle 1 compliance
Abbreviated field name `conns` violates predictable-names-over-short-names.
Renamed to `connections` throughout transport.go — 14 call sites updated.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:31:03 +01:00
Claude
ee8e6e1299
ax(mining): replace prose comments with usage examples in miner_factory
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>
2026-04-02 13:30:49 +01:00
Claude
84d0515974
ax(ueps): add field-level usage example comments to PacketBuilder
PacketBuilder.Header and .Payload lacked inline usage comments,
inconsistent with the pattern established by UEPSHeader fields.
AX Principle 2 requires comments as usage examples, not prose.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:30:29 +01:00
Claude
41761823d3
ax(ueps): expand ReadAndVerify comment to show error sentinel branches
AX Principle 2 — comments as usage examples: the ReadAndVerify doc
comment only showed the success path; both errMissingHMAC and
errIntegrityViolation sentinel branches are now illustrated so callers
can copy-paste correct dispatch logic.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:28:59 +01:00
Claude
5aa17421f6
ax(node): rename vague local variables in lethean.go to predictable names
`result` → `rpcResponse` in GetChainInfo, DiscoverPools, DiscoverGateways.
`parsed` → `commentFields` at call sites; `result`/`part` → `fields`/`segment`
in parseComment. Applies AX Principle 1: predictable names over short names.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:27:25 +01:00
Claude
db80ce6dde
ax(mining): rename wg to waitGroup in circuit breaker concurrency test
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>
2026-04-02 13:27:05 +01:00
Claude
96a450eff5
ax(node): remove banned fmt import from lethean.go
Replace fmt.Sprintf endpoint construction with string concatenation
and return errors directly, eliminating the banned fmt import.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:25:41 +01:00
Claude
4bca7bcced
ax(ueps): remove prose from Payload field comment, keep usage example only
AX Principle 2: comments show usage examples, not descriptions.
The trailing "raw bytes after the 0xFF payload tag" restated what
the tag constant already communicates — deleted.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:25:00 +01:00
Claude
b62c757ed7
ax(mining): replace prose comment on Uninstall with usage example
AX principle #2: comments must show HOW (concrete call), not describe
WHAT (which the signature already says).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:24:34 +01:00
Claude
8775947341
ax(node): complete HandleGetStats test triple with Bad and Ugly cases
TestWorker_HandleGetStats_Bad and TestWorker_HandleGetStats_Ugly were
missing; AX requires all three categories mandatory per function.
Bad covers uninitialised identity, Ugly covers failed miner stat collection.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:23:22 +01:00
Claude
5918ac3f1e
ax(ueps): add field-level usage example comments to ParsedPacket
ParsedPacket.Header and ParsedPacket.Payload lacked inline comments
showing concrete values, violating AX Principle 2 (comments as usage
examples). UEPSHeader had per-field examples; ParsedPacket now matches.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:21:38 +01:00
Claude
908f3f795b
ax(mining): replace prose comment on Service type with usage example
AX Principle 2: comments show HOW with real values, not WHAT the type is.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:20:46 +01:00
Claude
e0ed9048a1
ax(ueps): replace prose arrow comment with usage example on messageAuthCode
Comment "→ covers all header TLVs before the HMAC tag" was prose
describing effect rather than showing usage with concrete values,
violating AX Principle 2 (comments as usage examples, not descriptions).
Replaced with a full usage example showing all three messageAuthCode calls.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:19:43 +01:00
Claude
19b076002b
ax(node): replace prose comments with usage examples on encryptMessage/decryptMessage
AX Principle 2: comments must show usage, not restate the signature.
Both internal methods had descriptions that duplicated the function name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:17:54 +01:00
Claude
876d818216
ax(mining): replace prose comment with usage example on WriteStdin
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>
2026-04-02 13:17:30 +01:00
Claude
a212d1c5f0
ax(ueps): rename single-letter sentinel test variables to descriptive names
Variables e, a, b violate AX Principle 1 (predictable names over short names).
Renamed to sentinel, sentinelFirst, sentinelSecond across test functions and
the usage-example comment in packet.go.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:16:32 +01:00
Claude
895dec281b
ax(node): rename writeMu to writeMutex in PeerConnection
Abbreviation writeMu requires a reader to infer "mutex" — violates AX
Principle 1 (predictable names over short names). writeMutex is
self-describing with no mapping overhead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:15:51 +01:00
Claude
5de656ff04
ax(mining): replace prose type comments with usage examples in mining_profile.go
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>
2026-04-02 13:15:17 +01:00
Claude
5bf7509268
ax(node): rename nm/nm1/nm2 to nodeManager/nodeManager1/nodeManager2 in identity test
AX Principle 1: predictable names over short names. `nm` requires a
comment to explain; `nodeManager` is self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:14:08 +01:00
Claude
2dcdc48a68
ax(ueps): add missing sentinelError.Error() Good/Bad/Ugly tests
TestPacket_sentinelError_{Good,Bad,Ugly} were absent — AX requires all
three test categories for every exported and package-level function.
The Error() method on sentinelError had no direct coverage.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:13:39 +01:00
Claude
dc68334162
ax(mining): replace prose comment with usage example on NewXMRigMiner
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>
2026-04-02 13:12:24 +01:00
Claude
182a40d219
ax(mining): replace prose struct comments with usage examples
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>
2026-04-02 13:11:10 +01:00
Claude
519cbca6de
ax(node): rename errMsg to errorMessage in NewErrorMessage usage example
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:11:02 +01:00
Claude
413d735abf
ax(ueps): replace duplicate usage comment on sentinelError type
The comment on `sentinelError` restated the `errTLVValueTooLarge`
declaration directly above it (AX principle 2 violation). Replaced
with a distinct concrete example showing how to define any sentinel
of this type.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:10:42 +01:00
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