Commit graph

94 commits

Author SHA1 Message Date
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
Claude
f18991470d
ax(node): replace prose comments with usage examples on Controller
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Controller type and sendRequest had comments that restated the type
signature in prose. RFC-025 §2: if a comment restates what the type
signature says, delete it; show a concrete call instead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:28:02 +01:00
Claude
3ed2453413
ax(node): replace prose comment on NewNodeManager with usage example
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
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:25:06 +01:00
Claude
aab44e7814
ax(node): rename PeerRegistry.mu and saveMu to mutex and saveMutex
AX-1 (Predictable Names): abbreviated field names require mental mapping.
mutex and saveMutex are self-describing; mu and saveMu are not.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:22:48 +01:00
Claude
33db5f2dc6
ax(node): rename mu to mutex in NodeManager for AX Principle 1 compliance
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Short name `mu` requires context to decode; `mutex` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:20:35 +01:00
Claude
7a967b9249
ax(node): rename MessageDeduplicator.mu to mutex for AX Principle 1 compliance
Abbreviated field name `mu` violated AX Principle 1 (predictable names over
short names). Renamed to `mutex` to match the convention already used in the
sibling `PeerRateLimiter` struct in the same file.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:19:26 +01:00
Claude
35c178ce05
ax(node): replace prose comments with usage examples in PeerRegistry
AX Principle 2: comments that restate the type signature add zero
information. Replaced all prose-description comments on PeerRegistry
methods with concrete call-site examples that show real usage.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:18:29 +01:00
Claude
32290b839b
ax(node): replace prose comment with usage example on GetRemoteLogs
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 2 — comments must show HOW with real values, not restate
the signature in prose. "GetRemoteLogs requests console logs from a
remote miner" added zero information; replaced with a concrete call
showing peerID, minerName, lines, and result handling.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:15:35 +01:00
Claude
546d97ae6a
ax(node): replace prose comment with usage example on ParsePayload
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX-2: comments must show HOW with real values, not restate the signature.
"ParsePayload unmarshals the payload into the given struct" adds zero
information. Replaced with a concrete call showing the pattern callers
actually use throughout this package.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:14:28 +01:00
Claude
39e0df4de3
ax(node): replace AddPeer prose comment with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments restate the signature — replace with a concrete
call showing realistic values and the debounce behaviour as a note.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:13:10 +01:00
Claude
05fb333686
ax(node): replace prose comment with usage example on StopRemoteMiner
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 09:11:34 +01:00
Claude
0bb5287f4b
ax(node): replace prose comment with usage example on IsPublicKeyAllowed
AX Principle 2: comments show HOW with real values, not WHAT the function does.
"checks if a public key is in the allowlist" restates the signature — replaced
with a concrete call example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:08:17 +01:00
Claude
2646772ed6
ax(node): replace prose comment on VerifyBundle with usage example
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 09:06:38 +01:00
Claude
0c77689877
ax(node): rename mu to mutex in Controller (AX-1 predictable names)
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:05:26 +01:00
Claude
9ad9ecfa05
ax(node): replace prose-description comments with usage examples on MessageDeduplicator
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
IsDuplicate/Mark/Cleanup had comments restating the signature ("checks if",
"records a", "removes") — AX Principle 2 violation. Replaced with concrete
call-site examples showing how to sequence IsDuplicate → Mark → Cleanup.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:03:35 +01:00
Claude
9a7fd68e99
ax(node): replace prose comments with usage examples on crypto challenge functions
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
GenerateChallenge, SignChallenge, and VerifyChallenge had comments that
restated what the type signature already says. Replaced with concrete call
examples showing how each function is used in the handshake flow (AX §2).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:01:52 +01:00
Claude
315d052b15
ax(node): rename PeerRateLimiter.mu to mutex (AX-1 predictable names)
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:58:53 +01:00
Claude
89100776e9
ax(node): replace prose comment with usage example on StartRemoteMiner
RFC-CORE-008 Principle 2: comments show HOW with real values, not restate the signature.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:57:07 +01:00
Claude
28dfe3f31e
ax(node): replace prose comment with usage examples on IsProtocolVersionSupported
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:56:12 +01:00
Claude
0979fd1aea
ax(node): replace prose comment with usage example on GetRemoteStats
Some checks failed
Security Scan / security (push) Successful in 31s
Test / test (push) Has been cancelled
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 08:54:44 +01:00
Claude
df8d7189d8
ax(node): replace prose description with usage example on CreateProfileBundle
AX Principle 2: comments show HOW with real values, not WHAT the signature
already says. The prose "creates an encrypted bundle containing a mining
profile" restates the type signature — deleted in favour of a concrete call.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:52:42 +01:00
Claude
d886b3905c
ax(node): replace prose comments with usage examples on NewMessage and Reply
AX Principle 2: comments must show HOW with real values, not restate the
type signature in prose. The previous comments added zero information.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:50:39 +01:00
Claude
fbdb14e98f
ax(node): rename TestNewWorker to follow AX test naming convention
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle requires TestFilename_Function_{Good,Bad,Ugly}.
TestNewWorker → TestWorker_NewWorker_Good.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:48:41 +01:00
Claude
1ff90ba170
ax(node): replace prose comments with usage examples on PeerRegistry auth methods
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
SetAuthMode, GetAuthMode, AllowPublicKey, and RevokePublicKey all had
comments that restated the function signature rather than showing concrete
usage. Replaced with call-site examples per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:47:20 +01:00
Claude
4c355049e7
ax(node): remove dangling prose comment in peer.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Line 715 contained "// Example usage inside a connection handler" with no
code following it — a prose description stub with no usage example. This
violates AX Principle 2 (comments must show concrete usage with real values,
not describe intent in prose).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:44:40 +01:00
Claude
c7a3f553e9
ax(node): replace prose comment with usage example on calculateChecksum
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments that restate the type signature add zero information.
Replace with a concrete usage example showing how the return value is used.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:43:24 +01:00
Claude
8f7b6892ee
ax(node): replace prose comment on GetPeer with usage example
AX Principle 2: comments show HOW with real values, not WHAT the
signature already states. "GetPeer returns a peer by ID" restates
the function name — replaced with a concrete call pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:40:30 +01:00
Claude
b18aa741ba
ax(node): replace prose comment with usage example on IsProtocolError
AX Principle 2 — comments show HOW with real values, not what the
signature already says. "returns true if the error is a ProtocolError"
restates the type; a concrete call pattern teaches agents how to use it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:37:09 +01:00
Claude
92e8da2843
ax(node): rename TestConvenienceFunctions to AX-compliant TestProtocol_DefaultHandler_Good
TestConvenienceFunctions violated AX Principle 1 (predictable names — "ConvenienceFunctions"
is a vague label, not a description of what is tested) and Principle 10 (test naming must
follow TestFilename_Function_{Good,Bad,Ugly}).

Renamed to TestProtocol_DefaultHandler_Good, added a usage-example doc comment per
Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:35:17 +01:00
Claude
0c69d095de
ax(node): replace prose comment with usage example, rename ch to channel
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1: ch is an opaque abbreviation for a response channel — rename
to channel so the variable's role is predictable without tracing the map type.

AX Principle 2: "handleResponse processes incoming messages…" restates the
signature. Replaced with a concrete usage example showing how it is wired.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:32:39 +01:00
Claude
9a50e472b5
ax(node): replace Must* regexp anti-pattern with Compile in validatePeerName
Package-level regexp.MustCompile panics at startup on invalid pattern —
the Must* form explicitly banned by AX RFC-025 §6 (no hidden panics).
Move pattern to a const and compile via regexp.Compile inside the function.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:30:54 +01:00
Claude
f97975b4c1
ax(node): replace prose comments with usage examples in NodeManager
HasIdentity, GetIdentity, and GenerateIdentity had comments that
restated the type signature rather than showing concrete call patterns.
Replaced with AX-compliant usage examples per RFC-025 Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:28:58 +01:00
Claude
115672cdfd
ax(node): replace Send comment that restated the signature with a usage example
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 type
signature already says. "Send sends an encrypted message over the
connection." adds zero information.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:27:26 +01:00
Claude
df17944be5
ax(node): replace prose-description comments with usage examples in worker.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
All private handler function comments restated what the function name
already said (AX Principle 2 violation). Replaced with concrete call
examples showing how each handler is invoked.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:26:09 +01:00
Claude
da9e0d3982
ax(node): replace prose comment on HandleMessage with usage example
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. "processes incoming messages and returns a
response" restates the signature; the usage example shows how
HandleMessage is wired up via RegisterWithTransport.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:24:15 +01:00
Claude
b0dcb18d76
ax(node): remove banned fmt import from protocol_test.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace fmt.Errorf with a local testErr type to eliminate the banned
fmt import. The type carries its own usage example comment per AX
Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:22:25 +01:00
Claude
33659c311f
ax(node): replace prose comments with usage examples in protocol.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
ProtocolError and ResponseHandler had prose descriptions restating
their names — AX Principle 2 violation. Replaced with concrete call
examples showing how callers use each type.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:20:07 +01:00
Claude
785bb1ff76
ax(node): replace prose comment on ConnectedPeers with usage example
ConnectedPeers() had a comment that restated the function name ("returns
the number of connected peers"), violating AX Principle 2. Replaced with
a concrete usage example showing the guard pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:18:25 +01:00
Claude
463708aeab
ax(node): promote peer selection weights from var to const
Dimension weights are never reassigned — declaring them as mutable vars
implies changeability that does not exist. Const declares what IS (AX §5).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:16:44 +01:00
Claude
2adb53226c
ax(node): replace prose comment with usage example on DeriveSharedSecret
AX Principle 2 — comments show HOW with real values, not WHAT the
signature already says. The old comment restated the method name;
the new comment shows the exact call pattern used in transport.go.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:13:49 +01:00
Claude
6555e1211c
ax(node): add missing Bad and Ugly test triads for parseComment
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle 10 requires all three categories (Good, Bad, Ugly) per
function. lethean_test.go had only Good for parseComment; Bad (invalid
input, missing keys, empty values) and Ugly (empty string, semicolons
only, duplicate keys, value-with-equals) are now present.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:12:03 +01:00
Claude
d709b2125c
ax(node): expand abbreviated mutex field name per AX Principle 1
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Renamed `allowedPublicKeyMu` to `allowedPublicKeyMutex` in PeerRegistry.
`Mu` is an abbreviation that violates AX Principle 1 (predictable names
over short names) — the full word `Mutex` removes any ambiguity about
what the field represents.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:08:48 +01:00
Claude
b3219e9477
ax(node): rename resp/raw to response/responseBody in lethean.go
AX Principle 1: predictable names over short names. `resp` and `raw`
require mental mapping; `response` and `responseBody` are self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:05:27 +01:00
Claude
27e7f6ef74
ax(node): replace prose description on validatePeerName with usage examples
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 08:03:14 +01:00
Claude
0c3c472c44
ax(node): rename Transport.wg to waitGroup (AX Principle 1)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
'wg' is an abbreviation requiring mental mapping; 'waitGroup' names what
it IS — an explicit sync.WaitGroup, predictable across all call sites.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:01:48 +01:00
Claude
adbf31e987
ax(node): replace prose comments with usage examples in bufpool.go
AX Principle 2 — comments must show HOW with real values, not describe
WHAT the signature already says. Replaced three prose descriptions on
getBuffer, putBuffer, and MarshalJSON with concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:59:37 +01:00
Claude
248a413dae
ax(node): replace prose comment with usage example on Transport.Send
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments that restate the type signature add zero
information. Replaced "Send sends a message to a specific peer." with a
concrete call-site example showing error handling.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:58:01 +01:00
Claude
31ef201ff4
ax(node): replace prose comments with usage examples on Controller methods
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
PingPeer, ConnectToPeer, and DisconnectFromPeer had comments that
restated the signature in prose. AX-2 requires concrete call examples,
not descriptions. Replaced all three with usage-example comments.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:56:16 +01:00
Claude
45a1dcc987
ax(node): replace prose comment on NewMessageDeduplicator with usage example
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 07:54:06 +01:00