Commit graph

234 commits

Author SHA1 Message Date
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
501d7ecf11
ax(ueps): rename length/lengthByte to tagLength/tagLengthByte
AX Principle 1 — Predictable Names Over Short Names: `length` and
`lengthByte` are too generic for the TLV parsing context. Renamed to
`tagLength` and `tagLengthByte` so the variable names are
self-describing at read time.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:13:08 +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
8066610192
ax(ueps): remove prose comment that restated intent without a usage example
AX Principle 2: "If a comment restates what the type signature already says,
delete it." The "Store for processing" comment above the switch statement added
no information — the switch itself communicates that action.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:11:32 +01:00
Claude
301a5428b0
ax(mining): replace prose comment with usage example on findAvailablePort
AX Principle 2 — comments must show HOW with real values, not restate
what the function name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:11:24 +01:00
Claude
8e9f18ac3e
ax(mining): replace prose struct comment with usage example on CircuitBreaker
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 already says in its name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:08:29 +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
11cbfd5107
ax(ueps): replace prose claim with usage-example comment in MarshalAndSign_Ugly
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
TestPacket_MarshalAndSign_Ugly commented "modifying any byte breaks HMAC
verification" (prose description) but never called ReadAndVerify to prove it.
Replaced with a usage-example comment and an actual ReadAndVerify call that
asserts errIntegrityViolation is returned — AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:07:22 +01:00
Claude
cc829d1bc8
ax(mining): rename wg to waitGroup in collectMinerStats
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. `wg` requires
domain knowledge to decode; `waitGroup` is self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:06:48 +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
9dea4d6ac4
ax(ueps): replace errors.Is usage examples with direct sentinel comparison
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 requires comments to show correct usage patterns.
errMissingHMAC and errIntegrityViolation are tlvError sentinels (comparable
values), so the examples should use == not errors.Is from the banned errors
package.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:05:29 +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
1ad014e71c
ax(mining): replace prose comments with usage examples in repository.go
Three comments on Path, Exists, and Delete restated what the signatures
already convey. Replaced with concrete call examples per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:04:34 +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
599603e2f4
ax(mining): replace prose comment with usage example on FetchJSONStats
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 old comment restated the function's
prose description; replaced with a concrete call site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:03:17 +01:00
Claude
69c61cc74a
ax(ueps): rename err1/err2 to errorA/errorB per AX predictable-names principle
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:03:12 +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
7aada5fc78
ax(ueps): remove duplicate inline usage comment from ReadAndVerify body
AX-2 violation: usage examples belong at the declaration site, not
scattered inside function bodies. The errIntegrityViolation usage hint
was already present at the variable declaration (line 17) and was
duplicated inside ReadAndVerify, creating noise in the implementation.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:01:28 +01:00
Claude
7d7dfce6ea
ax(mining): replace prose comment with usage example on instanceNameRegex
AX Principle 2: comments show HOW with real values, not WHAT the name
already says. The old comment restated the variable name; the new comment
shows a concrete ReplaceAllString call with input and expected output.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:01:20 +01:00
Claude
5610491832
ax(mining): replace prose field comments on CircuitBreakerConfig with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
RFC-CORE-008 §2: comments that restate type signatures add zero information.
Replace the five prose comments (type-level + three field-level) with a single
concrete construction example showing real values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:59:01 +01:00
Claude
ddb62cb269
ax(ueps): use full variable name in TagHMAC and TagPayload comments
AX Principle 1 — predictable names over short names. Comments showing
usage examples must use the same full names as the implementation:
'buffer' not 'buf'.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:58:53 +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
0c6c84d4c6
ax(mining): replace prose comment with usage example on startTask
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. "startTask starts a single supervised task."
adds zero information — replaced with a concrete call site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:57:18 +01:00
Claude
9779caa10e
ax(ueps): remove prose comments inside ReadAndVerify that restate implementation
AX Principle 2: comments show usage, not prose descriptions of what the code
does. The two inline comments in ReadAndVerify described buffer reconstruction
in words rather than showing a call — deleted per RFC-025 §2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:57:10 +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
2b2b89f158
ax(mining): replace NewManager 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 show HOW with real values, not what the
signature already says. Replace "creates a new miner manager" prose
with a concrete call-site example showing manager lifecycle.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:56:15 +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
f4dbfcc251
ax(ueps): rename generic 'result' to 'encodedTLV' in writeTLV tests
AX Principle 1 — predictable names over short names. 'result' does not
describe what it holds; 'encodedTLV' names the TLV-encoded byte slice
exactly, matching the function under test.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:55:11 +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
0c7546650a
ax(mining): replace prose comment with usage example on ListMiners
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 08:54:33 +01:00
Claude
6ec5639265
ax(mining): replace banned fmt import with ErrInvalidConfig in Config.Validate
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Remove the banned `fmt` import from mining.go; all fmt.Errorf calls in
Config.Validate replaced with the existing ErrInvalidConfig helper which
returns a structured *MiningError — consistent with the package error model.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:52:52 +01:00
Claude
06d8878528
ax(ueps): replace prose constant comments with usage examples
TagHMAC and TagPayload had inline prose comments ("The Signature",
"The Data") that restated what the names already convey. Replace
with concrete call-site examples per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:52:49 +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
de6e4d019f
ax(ueps): rename value to tagValue in ReadAndVerify loop
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 generic
local variable `value` required surrounding context to understand;
`tagValue` is self-documenting at every read site in the switch.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:50:53 +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
6c0534a325
ax(mining): rename l to listener in findAvailablePort
Single-letter variable `l` violates AX Principle 1 (predictable names
over short names) — renamed to `listener` to match the semantic intent.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:50:23 +01:00
Claude
dae27bb10b
ax(ueps): remove surviving prose fragment from MarshalAndSign_Ugly comment
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:49:53 +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
11a3af4b1b
ax(mining): replace prose comment with usage example on GetMiner
RFC-CORE-008 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:48:13 +01:00
Claude
0c4cf1f7c3
ax(ueps): strip 11 prose test comments that restate function names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Test names encode intent — prose descriptions add zero information.
Per AX-2: if comment restates the signature, delete it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:48:01 +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
caa887325d
ax(mining): rename cfg to configuration in circuit_breaker_test.go
AX Principle 1 — predictable names over short names. `cfg` requires
context to decode; `configuration` is self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:47:09 +01:00
Claude
ae80737a41
ax(mining): replace prose comments with usage examples on LoadMinersConfig/SaveMinersConfig
Some checks failed
Security Scan / security (push) Successful in 30s
Test / test (push) Has been cancelled
AX Principle 2: comments as usage examples. Both functions had prose descriptions
that restated the signature ("loads the miners configuration from the file system").
Replace with concrete call-site examples that show how to use the return value.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:45:14 +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
565dae709d
ax(mining): replace banned errors import with ErrInternal in mining_profile.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
RawConfig.UnmarshalJSON used errors.New() (banned import) despite the
package already providing ErrInternal() for exactly this purpose.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:42:39 +01:00
Claude
03d326a97e
ax(mining): remove banned fmt import from errors.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replace fmt.Sprintf calls with string concatenation throughout
all MiningError constructors and the Error() method.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:40:59 +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
afbccd42f4
ax(mining): replace prose comment with usage example on Config.Validate
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 return
type contract; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:38:01 +01:00
Claude
e65057e8af
ax(ueps): rename buf→buffer in usage example comments
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Abbreviated names in comments teach agents bad patterns.
AX Principle 1 applies to usage examples too.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:37:35 +01:00