Commit graph

159 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
bf3b6c4b03
ax(node): replace prose constant comment with usage example
saveDebounceInterval had a description comment ("the minimum time between
disk writes") which restates what the name already says. Replaced with a
usage example showing the call site, per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:01:32 +01:00
Claude
8b49b73a6f
ax(node): rename f to outputFile in extractTarball (AX Principle 1)
Single-letter variable f is not in the permitted set (i, _, t, c).
outputFile names the handle by what it contains.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:53:43 +01:00
Claude
9394bbd768
ax(node): replace prose comments with usage examples on StreamBundle/ReadBundle
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 11:48:32 +01:00
Claude
f268b3990f
ax(node): rename abbreviated vars dirs/dir/mode to directories/directory/fileMode
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX-1: names that require a comment to explain are too short.
'dirs', 'dir', and 'mode' all needed the surrounding comment
to clarify their meaning; full names are self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:46:49 +01:00
Claude
360c6c9d56
ax(node): rename mac to messageAuthCode in SignChallenge (AX Principle 1)
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:43:55 +01:00
Claude
e9143e42b0
ax(node): replace prose comment on scheduleSave with usage example
AX Principle 2: comments show HOW with real values, not prose restating
what the name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:41:43 +01:00
Claude
b15b1654cb
ax(node): expand abbreviated json tag ts to timestamp on Message struct
AX Principle 1 — predictable names over short names. The wire format
field "ts" requires a reader to guess its meaning; "timestamp" is
self-documenting and consistent with every other field on the struct.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:36:07 +01:00
Claude
04c05c43a7
ax(node): replace prose comment with usage example on NewNodeManagerWithPaths
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 40s
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:33:27 +01:00
Claude
4e10e20a6b
ax(node): replace prose comment with usage example on GetConnection
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
AX Principle 2 — comments must show HOW with real values, not restate
what the signature already says. The old comment described the return
value in prose; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:31:36 +01:00
Claude
0a0751e2e0
ax(node): rename dir to directoryPath (AX Principle 1)
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Short variable name `dir` violated predictable-names-over-short-names.
Renamed to `directoryPath` in savePrivateKey, saveIdentity, and saveNow.

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