Commit graph

193 commits

Author SHA1 Message Date
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
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
66bb37326b
ax(mining): replace prose comments with usage examples on GetType/GetName
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. "GetType returns the miner type identifier" restates the
signature — replace with concrete call examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:35:47 +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
ed76d53b85
ax(mining): replace prose comment with usage example on LogBuffer.Clear
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 signature.
"Clear clears the log buffer." adds zero information beyond the name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:34:13 +01:00
Claude
58e1c23f0c
ax(ueps): replace prose threat comment with error-handling 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 08:33:58 +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
0432d23a63
ax(mining): rename cfg to configuration in circuit breaker usage comment
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 usage example
comment used the banned abbreviation `cfg` — replaced with `configuration`.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:32:21 +01:00
Claude
50548447fd
ax(mining): replace prose comment with usage example on recordSuccess
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 function name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:31:04 +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
9dbde075b2
ax(ueps): remove prose description from TestReader_ReadAndVerify_Good comment
AX Principle 2 — comments must be usage examples, not prose descriptions.
The leading "verifies a well-formed signed frame" line restated the test
name without adding information; the usage example below it was sufficient.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:30:33 +01:00
Claude
d122682387
ax(mining): replace signature-restating comments with usage examples in version.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
GetVersion/GetCommit/GetBuildDate comments restated the signature verbatim.
Replaced with concrete call examples showing realistic return values per AX-2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:30:02 +01:00
Claude
e0e80e990b
ax(ueps): strip 7 lines of implementation prose from MarshalAndSign
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Replaced descriptive rationale with 2-line factual comment + byte layout example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:29:22 +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
588e6447bb
ax(mining): replace prose Execute 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.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:28:45 +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
6704ac781c
ax(mining): replace prose comments with usage examples in settings_manager.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Seven setter/getter comments restated the function signature rather than
showing a concrete call (AX Principle 2). Replaced all with real invocation
examples so agents know exactly how to call each method.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:26:55 +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
f9ecce2e86
ax(mining): rename opts/opt to options/option in NewFileRepository
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.
`opts` and `opt` are abbreviations — `options` and `option` are unambiguous.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:25:14 +01:00
Claude
40b57849ff
ax(ueps): fix tlvError comment to show type usage, not sentinel usage
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The comment was a duplicate of errTLVValueTooLarge's example.
Fixed to show how tlvError defines new sentinels.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:25:01 +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
654a3e43c6
ax(mining): replace prose comments with usage examples in supervisor
Four exported methods on TaskSupervisor had comments restating the
signature (AX §2 violation). Replaced with concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:24:13 +01:00
Claude
3aa83c3e2b
ax(ueps): remove prose line from tlvError comment, keep 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 08:23:19 +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
7396ef0253
ax(mining): replace prose comments with usage examples in circuit_breaker.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 — comments as usage examples, not prose descriptions.
DefaultCircuitBreakerConfig, NewCircuitBreaker, State, Reset, GetCached
all had comments that restated the signature; replaced with concrete call examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:21:34 +01:00
Claude
0d9071d528
ax(ueps): replace prose errTLVValueTooLarge comment 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 08:20:47 +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
7232010b1f
ax(mining): rename cfg to configuration in UpdateMinersConfig closures
Closure parameters in UninstallMiner and updateMinerConfig used the
abbreviated name cfg instead of configuration, violating AX Principle 1
(predictable names over short names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:20:07 +01:00
Claude
6bc7812514
ax(mining): replace prose comments with usage examples in ratelimiter.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
All four exported function comments in ratelimiter.go were prose
descriptions that restate the signature (AX Principle 2 violation).
Replaced with concrete usage examples showing realistic call sites.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:18:40 +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
9ad8808d08
ax(ueps): replace prose sentinel error comments with usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
errMissingHMAC and errIntegrityViolation comments were prose
descriptions. Replaced with errors.Is() usage patterns.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:18:04 +01:00
Claude
bd4f47cbba
ax(mining): replace prose accessor comments with usage examples in SimulatedMiner
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.
Nine accessor methods converted from "Foo returns the bar" to concrete call examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:16:54 +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
8d89df10cc
ax(mining): rename fn to modifier in UpdateMinersConfig
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
`fn` is a single-letter abbreviation — AX principle 1 requires predictable
names over short names. `modifier` describes the parameter's role clearly.
Comment updated to a usage example per principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:14:35 +01:00
Claude
d6f69faf6b
ax(ueps): replace errors import in reader.go with tlvError sentinels
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:13:57 +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
aa9f0dd707
ax(mining): replace prose comments with usage examples in profile_manager.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
All public API comments on ProfileManager restated the type signature in
prose — violating AX principle 2 (comments as usage examples). Replaced
with concrete call examples showing realistic values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:12:59 +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
6bcd0494af
ax(mining): replace prose comment on WithDefaults 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.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:11:16 +01:00
Claude
72d85986c6
ax(ueps): add reader_test.go with Good/Bad/Ugly coverage for ReadAndVerify
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
One test file per source file is mandatory per AX conventions. reader.go
had no corresponding test file — this adds the three required test cases
covering valid round-trip, tampered frame rejection, and wrong-secret rejection.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:11:05 +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
743b819b99
ax(mining): replace prose comments with usage examples on Load and Save
SettingsManager.Load and Save had comments that restated the function
signature ("reads settings from disk", "writes settings to disk") rather
than showing a concrete call site. Replaced with usage examples per
AX Principle 2 (Comments as Usage Examples).

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