Commit graph

178 commits

Author SHA1 Message Date
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
Claude
95d62c11cf
ax(mining): rename enc to encoder in MarshalJSON for AX Principle 1
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:06:07 +01:00
Claude
9f510aea98
ax(mining): replace prose descriptions with usage examples in repository.go
AX-2 (Comments as Usage Examples): Load, Save, and Update on
Repository[T] and FileRepository[T] had comments that restated
the signature in prose. Replaced with concrete call examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:06:06 +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
82e52fb058
ax(ueps): rename parameter r to reader in ReadAndVerify
Some checks failed
Security Scan / security (push) Successful in 36s
Test / test (push) Has been cancelled
Single-letter parameter not in AX exception list.
r→reader across function signature and 4 call sites.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:04:28 +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
97b8b66241
ax(mining): replace prose comments with usage examples on RawConfig methods
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:03:04 +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
7cf7e13b51
ax(mining): replace prose comments in errors.go with usage examples
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. All 14 error constructor comments
converted from "ErrX creates a Y error" to concrete call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:01:02 +01:00
Claude
577775cbf8
ax(ueps): rename h→header and p→packet in usage example comments
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter variables in comments teach bad habits to agents.
Usage examples must use predictable names matching AX principle 1.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:00:43 +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
edcee49435
ax(mining): replace prose RegisterTask 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 07:58:45 +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
daf3c2fff9
ax(mining): rename cfg to minersConfiguration in manager.go (AX Principle 1)
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:57:18 +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
a08f3e3d31
ax(mining): replace banned errors import with NewMiningError in circuit_breaker.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
ErrCircuitOpen used errors.New (banned import). Replaced with
NewMiningError using the package's own error infrastructure.

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