Commit graph

491 commits

Author SHA1 Message Date
Claude
a8b2dad8ec
ax(ueps): rename tagByte to tagType in writeTLV for semantic clarity
tagByte described the storage representation; tagType names the semantic
role (the T in TLV = Type-Length-Value), matching AX Principle 1.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:52:23 +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
ecd417ac0e
ax(mining): replace prose description on Miner interface with usage examples
AX Principle 2: comments show HOW with real values, not WHAT the type signature already says.
The 12-line prose block restated what the interface methods communicate directly.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:52:05 +01:00
Claude
d5c892ae8c
ax(mining): replace prose comments on Lethean constants with usage examples
Some checks failed
Security Scan / security (push) Successful in 35s
Test / test (push) Has been cancelled
AX principle 2: comments that restate what the name already says add zero
information. LetheanMainnetPool, LetheanSoloTestnet and LetheanSoloMainnet
had "X is the Y for Z" comments replaced with concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:48:21 +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
d067eda037
ax(ueps): replace prose comment with usage example on ThreatScore default
AX Principle 2: comments must show concrete usage, not prose rationale.
"Assumed innocent until proven guilty" explains intent but shows no usage.
Replaced with a concrete mutation example per the RFC convention.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:47:18 +01:00
Claude
b28d0bd12f
ax(mining): replace prose comment on PerformanceMetrics with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX-2 violation: comment restated the type name rather than showing a
concrete usage example. Replaced with a call site example showing how
to call GetStats and access the Hashrate field.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:46:42 +01:00
Claude
28345a7d87
ax(mining): replace prose comments with usage examples on CheckInstallation
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2: comments must show HOW to call with realistic values,
not restate what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:45:30 +01:00
Claude
3153a44a4b
ax(ueps): rename writeTLV params tag→tagByte, value→tagValue
AX Principle 1: predictable names over short names. Parameters named
`tag` and `value` lack context; `tagByte` and `tagValue` are
self-documenting and consistent with the naming used in reader.go.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:45:25 +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
7b50431043
ax(ueps): replace prose comment with usage example in ReadAndVerify Ugly test
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
AX Principle 2: comments must be usage examples, not prose descriptions.
The inline comment restated intent in English rather than showing a concrete call.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:43:42 +01:00
Claude
bc5aa094dc
ax(mining): replace prose comment with usage example on findMinerBinary
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:43:06 +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
80b8b20507
ax(ueps): fix inaccurate usage example in ReadAndVerify default case
The comment omitted tagValueLength from the signedData write sequence,
making it an incorrect usage example (AX Principle 2).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:41:54 +01:00
Claude
2a43c0a39f
ax(mining): replace prose comment on UninstallMiner with usage examples
AX Principle 2: comments show HOW with real values, not WHAT the function does.
"stops, uninstalls, and removes" restates the signature — replaced with
concrete call examples showing both miner types.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:41:49 +01:00
Claude
0e31a6e99a
ax(mining): replace Manager prose comment with usage example
Some checks failed
Security Scan / security (push) Successful in 33s
Test / test (push) Has been cancelled
AX Principle 2: comments must show HOW with real values, not restate
what the type signature already says. Replaced the prose description
on Manager with a concrete call sequence.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:39:59 +01:00
Claude
0ab8c0fe7d
ax(ueps): remove redundant err shadow in ReadAndVerify payload branch
The inner scope re-declared `var err error` immediately before assigning
from `io.ReadAll`, unnecessarily shadowing the `err` already in scope from
`reader.ReadByte()`.  Removing the shadow simplifies the control flow and
eliminates the redundant declaration (AX Principle 1 — names should not
introduce unnecessary cognitive overhead).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:39:30 +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
b59fcc18a8
ax(mining): replace prose comment on ServeWs with usage example
AX §2 — comments show HOW with real values, not prose descriptions.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:38:21 +01:00
Claude
08089ffcd1
ax(ueps): replace abstract variable names in PacketBuilder comment with concrete values
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 with realistic values,
not abstract placeholder names. The struct-level comment for PacketBuilder
used `intentID` and `payload` (undefined in context); replaced with 0x01
and []byte("ping") so an agent reading it sees an exact working call.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:36:36 +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
3902917bc8
ax(mining): replace prose comment with usage example on UpdateMinersConfig
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 the
signature in prose. The description line was redundant with the signature;
only the usage example is kept.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:35:49 +01:00
Claude
4c279ac305
ax(mining): replace prose comments with usage examples in config_manager.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments must show usage, not restate the type signature.
Type and function comments on MinerAutostartConfig, DatabaseConfig,
defaultDatabaseConfig, MinersConfig, and getMinersConfigPath all violated
this by using "represents", "holds", and "returns" prose descriptions.
Replaced with concrete usage examples showing realistic values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:34:21 +01:00
Claude
e59346dda4
ax(ueps): use full parameter name in writeTLV usage-example comment
Comment used abbreviated `w` instead of the actual parameter name `writer`,
violating AX Principle 1 (predictable names over short names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:34:20 +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
1e24f8ef86
ax(ueps): replace prose ThreatScore comment with usage example
Some checks failed
Security Scan / security (push) Successful in 31s
Test / test (push) Has been cancelled
AX Principle 2: comments must show usage with concrete values, not
restate what the type signature already says. All other UEPSHeader
field comments used assignment examples; ThreatScore was the outlier.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:32:35 +01:00
Claude
f59e6f3050
ax(mining): replace prose comment on DefaultContainerConfig with usage example
AX principle 2: comments show HOW with real values, not what the
signature already says. The old comment restated the function name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:32:13 +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
0545d43685
ax(mining): replace prose comments with usage examples in bufpool.go
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
the type signature. Four prose-style doc comments converted to
concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:30:29 +01:00
Claude
186918bcc5
ax(ueps): replace abbreviated names buf/sig with buffer/hmacSignature in usage-example comment
Some checks failed
Security Scan / security (push) Successful in 33s
Test / test (push) Has been cancelled
AX Principle 1 — predictable names over short names. The const-block comment
used buf and sig; updated to buffer and hmacSignature to match the descriptive
naming used throughout the rest of the package.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:29:37 +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
5843720a49
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 that restate what the type signature says
add zero information. Deleted five internal-method comments that merely
described function intent, and replaced three exported-method comments
with concrete call-site examples so agents see how to use them.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:28:07 +01:00
Claude
2f2d863bed
ax(ueps): fix comment in reader.go default case to use real variable name
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The default switch case comment referenced `unknownTag` which does not
exist in scope; the actual variable is `tagByte`. AX Principle 2 requires
comments to show real, runnable examples — not invented identifiers.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:27:40 +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
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