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>
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>
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>
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>
The comment was a duplicate of errTLVValueTooLarge's example.
Fixed to show how tlvError defines new sentinels.
Co-Authored-By: Charon <charon@lethean.io>
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>
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>
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>
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>
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>
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>
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>
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>
errMissingHMAC and errIntegrityViolation comments were prose
descriptions. Replaced with errors.Is() usage patterns.
Co-Authored-By: Charon <charon@lethean.io>
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>
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>
`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>
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>
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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>
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>
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>
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>
ErrCircuitOpen used errors.New (banned import). Replaced with
NewMiningError using the package's own error infrastructure.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments as usage examples, not restatements of the
signature. "Count returns the number of registered peers." says nothing
the signature does not already say. Replaced with a concrete call site.
Co-Authored-By: Charon <charon@lethean.io>
mgr is an abbreviated variable name. AX Principle 1 requires predictable
names over short names — names should not require a comment to explain.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 1 — predictable names over short names: variable `copy` shadows
the Go builtin and carries no semantic meaning. Renamed to `settingsCopy`.
AX Principle 2 — comments as usage examples: replaced prose description on
SettingsManager.Get with a concrete call showing how the return value is used.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments that restate the function name add zero
information. Replace with a concrete call pattern showing iteration
over the returned map.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 1 — predictable names over short names. `mu` and `wg` require
mental mapping; `resultsMutex` and `waitGroup` state their purpose directly.
Co-Authored-By: Charon <charon@lethean.io>