Commit graph

330 commits

Author SHA1 Message Date
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
092aaf4870
ax(ueps): rename tagLengthByte/tagLength to tagValueLength
AX Principle 1 — the `Byte` suffix encodes storage type not semantics,
and the intermediate `tagLength` variable was an immediate int cast of
`tagLengthByte` with no additional meaning. Collapsed to a single
`tagValueLength` variable that names what it is, not how it is stored.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:25:39 +01:00
Claude
f23f5adcf2
ax(mining): replace prose comments with usage examples in ratelimiter
AX Principle 2: comments show HOW with real values, not prose descriptions.
cleanupLoop and cleanup had restatement comments; converted to call-site examples
matching the pattern used throughout the file.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:25:33 +01:00
Claude
eb13ef5a21
ax(mining): rename settings_manager tests to Good/Bad/Ugly convention
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
All test functions in settings_manager_test.go now follow
TestFilename_Function_{Good,Bad,Ugly} per AX RFC-025 §Test Naming.
Added _Bad (load from missing path) and _Ugly (concurrent access) cases
where only descriptive suffixes existed before.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:23:40 +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
729ad75d6f
ax(ueps): rename signature to hmacSignature for AX Principle 1 compliance
Some checks failed
Security Scan / security (push) Successful in 31s
Test / test (push) Has been cancelled
The variable name `signature` is ambiguous — any cryptographic operation
produces a signature. `hmacSignature` is unambiguous and self-describing,
consistent with the TagHMAC comment that already used `hmacSignature` as
the example parameter name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:22:18 +01:00
Claude
c34e6da043
ax(mining): replace single-letter loop variable p with profile in profile_manager.go
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): `p` is not an
allowed single-letter variable. Only `i`, `_`, `t`, and `c` are
permitted. Replace all three `p` loop variables with `profile`.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:21:40 +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
5db57c38f0
ax(mining): rename mi to entry in collectMinerStats range loop (AX-1)
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
Short variable `mi` is ambiguous — `entry` matches the `minerInfo` struct
semantics and requires no abbreviation mapping.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:17:43 +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
4cd24158eb
ax(ueps): replace prose comment with usage example on default tag case
AX Principle 2: comments must show usage, not describe intent in prose.
The default switch branch comment was prose-first; rewritten as a
concrete call-site example that shows what the code does and why.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:16:38 +01:00
Claude
9a95c8be54
ax(mining): rename SettingsManager receiver sm to settingsManager
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX-1 violation: receiver name `sm` is an abbreviation that requires
context to decode. Renamed to `settingsManager` throughout, matching
the predictable-names-over-short-names principle from RFC-CORE-008.
Also corrects a comment that referenced the banned `log.Fatal` call.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:16:10 +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
aae2734273
ax(ueps): replace prose section label with usage example on const block
// TLV Types restated what Tag* names already made obvious (AX §2 violation).
Replace with a concrete usage example showing the three-tag write sequence.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:14:50 +01:00
Claude
114dd90081
ax(mining): replace prose comments with usage examples in simulated_miner.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments must show concrete usage, not restate the signature.
Four functions (NewSimulatedMiner, Stop, GetStats, SimulatedMinerPresets) had
"X does Y" prose descriptions replaced with call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:13:57 +01:00
Claude
6b22f2b60d
ax(mining): replace prose comments with usage examples in miner_factory.go
Some checks failed
Security Scan / security (push) Successful in 29s
Test / test (push) Has been cancelled
AX Principle 2 — comments must show usage, not restate the signature.
MinerConstructor, MinerFactory, and NewMinerFactory had prose descriptions
that added no information beyond what the type already states.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:11:37 +01:00
Claude
3ba5080234
ax(ueps): replace prose field comments with usage examples on UEPSHeader
CurrentLayer and TargetLayer had prose descriptions restating the field
names. AX Principle 2 requires comments to show concrete usage with real
values, not restate what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:11:26 +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
f70e0b9f53
ax(mining): replace signature-restating comments with usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Five comments in Manager were restating what the function signature
already showed ("returns X for Y"). Replace with concrete call
examples per AX principle 2 (Comments as Usage Examples).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:09:01 +01:00
Claude
ba4c5398b1
ax(ueps): replace prose comment with usage example in MarshalAndSign test
AX Principle 2 — comments show HOW with real values, not prose describing
what the code does. "Verify each expected tag is present in the frame"
restated intent with zero new information; replaced with a concrete call
showing the bytes.Contains check and the expected result.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:08:51 +01:00
Claude
a433b37de1
ax(mining): replace prose comment with usage example on GetComponentFS
Some checks failed
Security Scan / security (push) Waiting to run
Test / test (push) Has been cancelled
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:07:18 +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
57fff3ddd2
ax(ueps): rename buffer to frameBuffer in MarshalAndSign (AX Principle 1)
Generic name "buffer" violates predictable-names-over-short-names.
"frameBuffer" names the thing by what it holds.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:06:27 +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
f28d1c3c9c
ax(mining): replace FileRepository prose comment with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 2: comments show HOW with real values, not WHAT the type does.
The FileRepository struct comment described implementation details instead
of demonstrating how to construct and use the type.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:05:33 +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
c8edfee8ae
ax(ueps): add usage-example comment on default HMAC coverage path
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments as usage examples. The default switch case in
ReadAndVerify silently included unknown extension tags in signedData with
no explanation of why; added a concrete comment showing the pattern and
the security rationale (tag-injection prevention).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:04:01 +01:00
Claude
842508661f
ax(mining): replace prose comments with usage examples on BaseMiner hashrate methods
GetHashrateHistory and AddHashratePoint had comments that restated the
function name in different words (AX principle 2 violation). Replaced
with concrete call-site examples showing realistic values and return
shape.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:04:00 +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
3f93aa4a47
ax(mining): replace prose comment on ListAvailableMiners with usage example
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 10:01:59 +01:00
Claude
794a584766
ax(ueps): replace prose comment with usage example in writeTLV
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle 2 requires comments to show HOW via concrete examples,
not describe WHAT the code does in prose.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:01:06 +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
f32bf6f3ba
ax(mining): replace prose comment on NewTaskSupervisor with usage example
AX Principle 2: comments show HOW with real values, not WHAT the
function name already says. All other constructors in the file already
use usage-example comments; NewTaskSupervisor was the outlier.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:00:10 +01:00
Claude
60997f79d2
ax(mining): replace prose comments with usage examples on BaseMiner methods
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
GetPath, GetBinaryPath, and Stop had comments that restated what the
signature already said. AX Principle 2: comments show HOW with real
values, not WHAT the type signature already declares.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:58:17 +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
3d310faec7
ax(ueps): replace prose comments with usage examples in MarshalAndSign
Numbered step comments ("2. Calculate HMAC", "3. Write HMAC TLV") and
inline narration violated AX Principle 2 — comments must show concrete
usage, not restate what the code already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:58:02 +01:00
Claude
6118522c44
ax(ueps): replace prose rationale comment with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
MarshalAndSign had a prose comment "We write these first because they
are part of what we sign." — deleted per AX Principle 2 (comments as
usage examples, not prose descriptions). Replaced with a concrete
writeTLV call showing the wire encoding output.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:56:44 +01:00
Claude
ddfd62b8ce
ax(mining): replace prose comments with usage examples in settings_manager
Three comments restated the function/type name in prose (AX principle 2
violation). Replaced with concrete call-site examples showing real usage.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:56:40 +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
9664de2330
ax(mining): replace prose Config comment with usage example
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 30s
AX principle 2: comments must show usage with realistic values, not
restate what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:54:19 +01:00
Claude
9a9be5be2f
ax(ueps): rename TestPacket_NewBuilder_* to TestPacket_NewPacketBuilder_*
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Test names must match the exact function name (NewPacketBuilder), not an
abbreviated form (NewBuilder). AX principle 1: predictable names over short names.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:51:59 +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
e4144c5f48
ax(mining): replace prose comment with usage example on FetchLatestGitHubVersion
AX Principle 2: comments must show concrete usage, not restate the signature.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:51:39 +01:00
Claude
5cd0e96a6e
ax(ueps): align const block and fix comment spacing in packet.go
Misaligned const tag values and trailing comment spacing violated
gofmt canonical formatting, reducing readability for agents scanning
the TLV tag table.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:51:38 +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
22d67f94c2
ax(mining): replace banned errors import with package error constructors in miner.go
Stop() and WriteStdin() used errors.New() (banned import) instead of the
package's own MiningError constructors. Replaced with ErrMinerNotRunning()
and ErrTimeout() which carry structured codes, HTTP status, and retry hints.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:50:43 +01:00
Claude
61c11cc0ee
ax(mining): replace prose comments with usage examples in events.go
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. Converted all exported function/method prose
descriptions to concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:49:06 +01:00
Claude
a565d77b7b
ax(ueps): remove prose step comments from ReadAndVerify per AX Principle 2
Internal numbered step comments (1. Read Tag, 2. Handle Payload Tag, etc.)
restate what the code does rather than showing concrete usage examples.
Per RFC-CORE-008 Principle 2: delete comments that restate what the code
already expresses; keep only usage examples with realistic values.

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