Commit graph

142 commits

Author SHA1 Message Date
Claude
d400946352
ax(node): rename u to peerURL in Transport.Connect
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter variable name violates AX Principle 1 (predictable names
over short names). peerURL is self-describing without requiring context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:26:37 +01:00
Claude
a10adc881b
ax(node): rename message_test.go functions to TestMessage_Function_{Good,Bad,Ugly}
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 10 requires test names to follow TestFilename_Function_{Good,Bad,Ugly}.
message_test.go used bare names (TestNewMessage, TestMessageReply, etc.) with no
suffix. Added Bad/Ugly cases for ParsePayload (nil payload, malformed JSON).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:25:07 +01:00
Claude
3a690ee485
ax(node): rename nm to manager in NewNodeManagerWithPaths for predictable naming
AX Principle 1 — nm abbreviates NodeManager, requiring mapping overhead.
Rename to manager and update the NewNodeManager usage-example comment to match.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:21:55 +01:00
Claude
a6eb29a486
ax(node): replace prose comment with usage example on extractTarball
RFC-025 Principle 2 — comments must show a concrete call with realistic
values, not restate what the signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:20:01 +01:00
Claude
cb02cdb6b8
ax(node): replace prose comment with usage example on handleWSUpgrade
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The comment "handleWSUpgrade handles incoming WebSocket connections" restated
the function signature without adding information. Replaced with a concrete
call-site example showing how the method is wired in via Start().

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:18:29 +01:00
Claude
fd1aed63fe
ax(node): replace prose comment on NewErrorMessage 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 type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:13:41 +01:00
Claude
10241f5803
ax(node): rename Caps to Capabilities on PoolGateway struct
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 1 — predictable names over short names.
`Caps` is an abbreviation that requires context to understand;
`Capabilities` is self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:11:41 +01:00
Claude
e0893bd299
ax(node): replace prose comment on NewTransport with usage example
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
AX Principle 2: comments must show how to call the function with real
values, not restate what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:08:21 +01:00
Claude
a8e962a4df
ax(node): replace prose Worker comment with usage example
Principle 2: comments show HOW with real values, not WHAT the type is.
The old comment restated the struct name; the new block demonstrates the
full setup sequence an agent needs to wire a Worker.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:06:08 +01:00
Claude
6d77de500d
ax(node): rename dedup field to deduplicator in Transport struct
AX Principle 1: predictable names over short names. The abbreviated
struct field `dedup` requires a reader to mentally expand it; the
full name `deduplicator` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:03:44 +01:00
Claude
51595300a2
ax(node): rename abbreviated dn to dataNode in CreateMinerBundle
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 1 — predictable names over short names. `dn` is an
opaque abbreviation for a *datanode.DataNode; `dataNode` conveys
the type at a glance without requiring context lookup.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:02:28 +01:00
Claude
5188cb617c
ax(ueps): remove redundant inline comment that restates the pre-function docstring
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
AX Principle 2: comments that restate what the surrounding code already
says are noise. The inline comment inside TestReader_ReadAndVerify_Ugly
duplicated the usage example already present in the function docstring.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:01:18 +01:00
Claude
2a5a3d6393
ax(node): add missing Bad and Ugly test variants for HandlePing
AX Principle 10 requires all three categories (Good, Bad, Ugly) for
every test function. TestWorker_HandlePing had only Good; add Bad
(invalid payload) and Ugly (zero SentAt edge case).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:58:46 +01:00
Claude
871e6dd985
ax(node): replace prose comment on DefaultTransportConfig with usage example
AX Principle 2: comments must show HOW with real values, not restate what
the type signature already says. "returns sensible defaults" adds zero
information — the concrete call pattern teaches agents exactly how to use it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:55:02 +01:00
Claude
e69816f978
ax(node): rename n to connectionCount in ConnectedPeers usage example
AX Principle 1: predictable names over short names. The comment example
used `n` which requires context to understand; `connectionCount` is
self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:53:09 +01:00
Claude
ba9da9444c
ax(node): replace banned strings import with bytes in lethean.go
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 41s
strings is a banned import per AX conventions. Replace strings.NewReader,
strings.Contains, strings.Split, and strings.IndexByte with bytes equivalents.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:52:06 +01:00
Claude
ed4a8637cd
ax(node): rename NodeManager receiver from n to manager
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 receiver `n`
for *NodeManager is a non-standard abbreviation; only `i`, `_`, `t`,
and `c` are permitted single-letter receivers per RFC-CORE-008.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:47:48 +01:00
Claude
5b6a607018
ax(node): enforce TestFilename_Function_{Good,Bad,Ugly} naming in peer_test.go
All peer registry test functions lacked the mandatory category suffix
required by AX-10 (CLI tests as artifact validation / test naming
convention). Renamed every test to carry _Good, _Bad, or _Ugly and
split the former monolithic AddPeer test into three focused cases.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:44:20 +01:00
Claude
ab83727e47
ax(node): rename abbreviated tar variables to predictable full names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace `tw`, `tr`, `buf`, `hdr` with `tarWriter`, `tarReader`,
`buffer`, `header` in createTarball and extractTarball per AX
Principle 1 (predictable names over short names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:42:02 +01:00
Claude
22a74415f3
ax(node): rename d to deduplicator in NewMessageDeduplicator (AX-1)
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
Single-letter variable `d` requires a reader to infer its type from
context. Rename to `deduplicator` — predictable names over short names
(RFC-CORE-008 §1).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:38:29 +01:00
Claude
6aea40d90c
ax(node): replace GoDoc prose+code-block comments with AX usage examples in lethean.go
RFC-CORE-008 Principle 2: comments show HOW with real values, not WHAT the
function does in prose. Removed GoDoc-style blank-line indented blocks and
replaced with inline concrete call examples on every type and function.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:36:31 +01:00
Claude
274cb73ab6
ax(node): rename local var c to controller in NewController
Single-letter c is reserved for *core.Core (AX Principle 1 — predictable
names over short names). Using c for a *Controller introduces semantic
ambiguity; controller makes the type intent self-evident.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:34:19 +01:00
Claude
d9f45773b4
ax(node): rename Controller receiver from c to ctrl
AX-1: c is reserved for *core.Core receivers per RFC-CORE-008.
Controller methods used c as the receiver name which creates
semantic ambiguity. Renamed to ctrl to match the usage examples
already present in the comment blocks.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:32:07 +01:00
Claude
7a87f2e633
ax(node): replace prose comments with usage examples in protocol.go
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
ValidateResponse, ParseResponse, and GetProtocolErrorCode had comments
that restated the function signature in prose — violating AX Principle 2
which requires comments to show concrete call-site usage, not descriptions.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:28:54 +01:00
Claude
3cf01162d5
ax(node): rename loop variable p to peer in GetPeersByScore
AX Principle 1 — predictable names over short names. Single-letter
variable p in GetPeersByScore replaced with peer, matching the type
it holds and the usage in surrounding code.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:27:32 +01:00
Claude
6d70f4a85f
ax(node): replace prose comments with usage examples on private identity methods
Some checks failed
Security Scan / security (push) Successful in 29s
Test / test (push) Has been cancelled
AX-2: comments that restate the function name add zero information.
savePrivateKey, saveIdentity, and loadIdentity now show a concrete
call-site with context on when each is invoked.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:25:57 +01:00
Claude
bf44c296d9
ax(node): add usage example comment to parseComment
AX-2: every function must show a concrete call with real values, not
prose. parseComment had no comment at all — added three-line example
showing input string, key lookup, and expected return values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:23:23 +01:00
Claude
e4989be633
ax(node): rename tmpPath to temporaryPath in peer registry save
AX Principle 1: predictable names over short names.
`tmp` is an abbreviation requiring mental mapping; `temporaryPath`
is unambiguous and self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:21:31 +01:00
Claude
6854b7b054
ax(node): replace prose comment with usage example on PeerConnection.Close
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. "Close closes the connection." adds zero
information; a usage example shows call site and error handling pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:16:45 +01:00
Claude
35da3edcab
ax(node): rename bundle_test.go functions to TestFilename_Function_{Good,Bad,Ugly} convention
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
All 10 test functions in bundle_test.go lacked the AX Principle 10 naming
convention. Renamed to TestBundle_* with _Good/_Bad/_Ugly suffixes and
converted inlined Bad/Ugly subtests into top-level functions where needed.
Added usage-example comments per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:15:00 +01:00
Claude
1d319b5f96
ax(node): rename n to count in SelectNearestPeers (AX-1 predictable names)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter parameter n violates AX Principle 1 — names must be
predictable without a comment to explain them. count is unambiguous.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:11:11 +01:00
Claude
4990e78156
ax(node): rename worker_test.go functions to Good/Bad/Ugly convention
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
Test function names lacked the required {Good,Bad,Ugly} suffix mandated
by AX Principle 10. Renamed HandlePing and HandleGetStats (missing suffix),
and _NoManager/_Profile/_UnknownType variants to _Bad/_Bad/_Ugly.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:09:20 +01:00
Claude
985fc78c40
ax(node): rename TestWorker_SetProfileManager to include _Good suffix
AX Principle 10 requires test functions follow TestFilename_Function_{Good,Bad,Ugly}
naming. TestWorker_SetProfileManager was missing the mandatory category suffix.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:07:07 +01:00
Claude
0074577210
ax(node): rename pr to peerRegistry in worker_test.go
AX-1 (Predictable Names): the local variable `pr` is an abbreviation
that requires context to decode. Renamed to `peerRegistry` across all
test functions so the type is self-evident at the point of use.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:06:24 +01:00
Claude
482b2e6f23
ax(node): replace prose description with usage example on SelectNearestPeers
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 10:04:15 +01:00
Claude
aca34610e6
ax(node): expand abbreviated variable names in bufpool to predictable full names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Renames `buf` to `buffer` and `enc` to `encoder` throughout bufpool.go.
AX Principle 1 — predictable names over short names: abbreviations increase
semantic ambiguity for agents pattern-matching across the codebase.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:02:11 +01:00
Claude
c603303f1e
ax(node): rename test and add Good/Bad/Ugly suite for NewPeerRegistry
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestPeerRegistry_NewPeerRegistry violated AX-10 (test naming must follow
TestFilename_Function_{Good,Bad,Ugly}). Renamed to TestPeer_NewPeerRegistry_Good
and added Bad (unwritable path) and Ugly (corrupted JSON) cases.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:00:15 +01:00
Claude
50169f5a8e
ax(node): replace prose comments with usage examples in transport.go
Four functions in Transport had comments that restated the signature
("sets the handler", "establishes a connection", "sends a message to all
connected peers") rather than showing concrete call examples. Converted
to AX Principle 2 style — usage examples with realistic values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:58:10 +01:00
Claude
9a38c8d547
ax(node): add _Good suffix to TestWorker_SetMinerManager per AX-10 test naming
AX-10 requires test functions follow TestFilename_Function_{Good,Bad,Ugly}.
TestWorker_SetMinerManager tested only the happy path with no suffix.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:56:33 +01:00
Claude
66d925ab56
ax(node): replace prose comment with usage examples on isJSON
AX Principle 2: comments must show how to call the function, not
restate what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:51:58 +01:00
Claude
a27cedd0a5
ax(node): replace prose comments with usage examples on ExtractProfileBundle and ExtractMinerBundle
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:50:43 +01:00
Claude
d56f6749ad
ax(node): replace prose comments with usage examples on Start/Stop
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Transport.Start and Transport.Stop had prose comments that restated
the function name — the pattern AX Principle 2 explicitly bans.
Replaced with concrete call-site examples showing how callers use them.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:47:21 +01:00
Claude
a1939ff5f7
ax(node): rename identity test functions to AX TestFilename_Function_{Good,Bad,Ugly} convention
TestNodeIdentity, TestNodeRoles, TestChallengeResponse violated AX Principle 2 (test
naming). Renamed to TestIdentity_NodeManager_Good, TestIdentity_NodeRoles_Good,
TestIdentity_ChallengeResponse_Good to follow the mandatory TestFilename_Function_Good
naming pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:45:13 +01:00
Claude
89599c122c
ax(node): replace prose comments with usage examples in bundle.go
CreateProfileBundleUnencrypted and CreateMinerBundle had comments that
restated the signature in prose. AX Principle 2 requires comments to
show a concrete call with realistic values, not describe what the type
signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:43:00 +01:00
Claude
cbc876fdaf
ax(node): rename single-letter goroutine parameter p to connectedPeer
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 goroutine
parameter in GetAllStats used `p *Peer` — a single-letter abbreviation
with no justification under the AX exception list (i, _, t, c only).
Renamed to `connectedPeer` to match the variable's semantic role.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:41:18 +01:00
Claude
e837423cb7
ax(node): replace prose comment with usage example on PeerRateLimiter.Allow
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:39:46 +01:00
Claude
21d205a0dc
ax(node): rename pr to registry in NewPeerRegistryWithPath
`pr` abbreviates PeerRegistry — violates AX Principle 1
(predictable names over short names). Renamed to `registry`
so the variable is self-describing without context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:37:22 +01:00
Claude
df8f17c1cb
ax(node): replace prose comment with usage example on ParseResponse
AX Principle 2 — comments show HOW with real values, not what the
signature already says. The previous comment restated the method name
as prose; replaced with a concrete call pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:34:58 +01:00
Claude
2ea46d8ec0
ax(node): rename Transport.mu to mutex (AX Principle 1)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Abbreviated field name `mu` is ambiguous — rename to `mutex` to satisfy
AX-025 §1 (predictable names over short names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:33:54 +01:00
Claude
017d386c6d
ax(node): fix test name to follow TestFilename_Function_Good convention
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestConvertMinerStats did not follow the AX Principle 10 test naming
convention (TestFilename_Function_{Good,Bad,Ugly}). Renamed to
TestWorker_ConvertMinerStats_Good to match the required pattern.

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