Commit graph

539 commits

Author SHA1 Message Date
Claude
8ce93adf11
ax(mining): rename Container.mu to mutex (AX Principle 1)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
`mu` is an abbreviation that requires context to understand. AX Principle 1
mandates predictable names over short names — `mutex` is unambiguous.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:03:42 +01:00
Claude
fb998ce2df
ax(node): replace banned path/filepath with path in worker.go
worker.go imported path/filepath (banned import) solely for two
filepath.Join calls building the miner install directory path.
Replaced with path.Join from the stdlib path package which is
not banned and behaves identically on Linux for absolute paths.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:03:13 +01:00
Claude
6df2566acb
ax(ueps): include method name in sentinelError test names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestFilename_Function_{Good,Bad,Ugly} requires the function being
tested, not just the type name. sentinelError tests exercise the
.Error() method so names must be TestPacket_sentinelError_Error_*.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:02:58 +01:00
Claude
0fe74ae8a6
ax(mining): replace pm abbreviation with profileManager in usage-example comments
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
AX Principle 1 (predictable names over short names): usage-example comments
in profile_manager.go used the abbreviated `pm` receiver throughout, while all
production code uses the full `profileManager` name. Comments are teaching
material — agents and readers learn from them. Aligning examples with the actual
variable name removes the abbreviation mapping overhead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:02:17 +01:00
Claude
68ee594149
ax(node): replace prose comment on ProfileManager with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Principle 2 (Comments as Usage Examples): the ProfileManager interface
comment described what the interface was rather than showing how to use it.
Replaced with concrete call examples for GetProfile and SaveProfile.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:02:05 +01:00
Claude
61c45810ba
ax(ueps): rename header to packetHeader for AX Principle 1 compliance
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Generic name `header` replaced with `packetHeader` throughout ReadAndVerify
to satisfy AX predictable-names-over-short-names; the name now conveys what
is being built without requiring context from the surrounding function.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:01:08 +01:00
Claude
c03b040240
ax(node): replace prose comment on GracefulClose with usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments as usage examples, not prose descriptions.
The previous comment restated what the function name already conveyed.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:00:25 +01:00
Claude
a97f93b919
ax(mining): replace banned errors import with domain error constructors
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
xmrig_stats.go and ttminer_stats.go used errors.New() despite the
package providing ErrMinerNotRunning() and ErrInternal() for exactly
these cases. Removes banned errors import from both files.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:00:08 +01:00
Claude
7f02b47445
ax(ueps): rename tagLengthByte to tagLength — type suffix violates AX Principle 1
Variable name tagLengthByte encoded its type (byte) rather than its role
(the length field of a TLV record). AX Principle 1: names must be semantic,
not type-annotated. tagLength is unambiguous without the redundant Byte suffix.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:59:57 +01:00
Claude
7a121b7d18
ax(mining): rename mu to mutex in BaseMiner and LogBuffer (AX Principle 1)
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 13:59:06 +01:00
Claude
316049d3ae
ax(ueps): make Bad test comment a self-contained usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestReader_ReadAndVerify_Bad referenced `frame` without defining it in
the comment block, leaving an agent without enough context to understand
the setup. Replace with a complete, standalone snippet showing frame
construction, corruption, and the expected error outcome.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:58:30 +01:00
Claude
98d34ffd07
ax(node): replace banned strings import with bytes.HasPrefix in bundle.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The strings package is banned per AX conventions. Both HasPrefix calls in
extractTarball now use bytes.HasPrefix with the bytes package already imported.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:58:05 +01:00
Claude
0ffae0c646
ax(mining): rename configMu to configMutex in config_manager (AX Principle 1)
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 13:57:26 +01:00
Claude
6149d7b283
ax(mining): rename mu to mutex in EventHub for AX Principle 1 compliance
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Abbreviated field name `mu` replaced with `mutex` throughout EventHub
to satisfy the predictable-names-over-short-names rule (RFC-025 §1).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:55:00 +01:00
Claude
4b8271647a
ax(node): replace prose MinerInstance comment with usage example
AX Principle 2: comments show HOW with real values, not restate
what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:54:44 +01:00
Claude
be6f915ac5
ax(ueps): rename tagValueLength to tagLengthByte to signal byte type
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Variable named tagValueLength implied int semantics but held a byte
value from ReadByte(); AX Principle 1 requires names that are
unambiguous without comments — tagLengthByte makes the type explicit
and the int(tagLengthByte) cast at make() call site clarifies the
byte→int conversion for agent readers.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:53:22 +01:00
Claude
311e457e35
ax(node): rename PeerRegistry receiver r to registry
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 receiver `r` on PeerRegistry is a single-letter abbreviation;
all 29 methods now use `registry` for consistency with the rest of
the node package (controller, worker, transport all use full names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:52:26 +01:00
Claude
ee8b3e6499
ax(mining): rename receiver s to supervisor on TaskSupervisor (AX Principle 1)
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 13:50:53 +01:00
Claude
22b6e8ace6
ax(node): replace prose comment with usage example on createTarball
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 function
signature in prose; replaced with a concrete call showing filename/
content pairs.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:49:16 +01:00
Claude
b55b2dd945
ax(mining): replace prose comment on Stop with usage example
AX Principle 2 — comments show HOW with real values, not WHAT the
signature already says. "Stop gracefully stops the service" restates
the name; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:48:45 +01:00
Claude
95cb6b6570
ax(node): replace prose comment with usage example on PeerAuthMode
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
AX Principle 2 — comments show HOW, not WHAT. The prose description
"controls how unknown peers are handled" restates the type name.
Replaced with concrete SetAuthMode call examples showing both modes.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:47:51 +01:00
Claude
889636fff4
ax(mining): replace prose comments with usage examples in manager_test.go
AX Principle 2: comments must show HOW with real values, not restate
the function name. Four prose comments replaced with concrete call
examples showing inputs and expected outcomes.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:47:00 +01:00
Claude
ea40c035b5
ax(ueps): expand MarshalAndSign comment to full usage example with error handling
AX Principle 2: comments show concrete usage with realistic values, not
minimal call-site only. Single-line comment omitted error handling and
downstream use — now shows the complete call pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:45:50 +01:00
Claude
af8f82f95a
ax(mining): rename mu to mutex in FileRepository (AX Principle 1)
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:40:56 +01:00
Claude
f005921de9
ax(node): rename PeerRateLimiter receiver r to limiter
Single-letter receiver names are banned by AX Principle 1 except for
i (range loops), _ (discards), t (tests), and c (*core.Core).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:40:44 +01:00
Claude
ecad4f5555
ax(mining): add usage example comments to MiningError builder methods
WithCause, WithDetails, WithSuggestion, IsRetryable, and StatusCode were
exported methods with no comment — violating AX Principle 2 (comments as
usage examples).

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