The comment "handleWSUpgrade handles incoming WebSocket connections" restated
the function signature without adding information. Replaced with a concrete
call-site example showing how the method is wired in via Start().
Co-Authored-By: Charon <charon@lethean.io>
DatabaseConfig field comments restated the type signature in prose
(AX §2 violation). Replaced with concrete assignment examples showing
real values and edge-case behaviour (0 → defaults to 30).
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments show HOW with real values, not variable
references. Replace builder.Header.Version with the concrete 0x09
literal so the comment matches what the output annotation shows.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 1 — predictable names over short names.
`Caps` is an abbreviation that requires context to understand;
`Capabilities` is self-documenting.
Co-Authored-By: Charon <charon@lethean.io>
AX principle #2: comments that restate the function name add zero information.
Replace with a concrete call example showing what the method does at runtime.
Co-Authored-By: Charon <charon@lethean.io>
tlvError used an abbreviated subsystem name (tlv = Type-Length-Value),
requiring domain knowledge to decode. packetError is self-describing
from the path alone, matching the AX rule: predictable names over short names.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments must show how to call the function with real
values, not restate what the type signature already says.
Co-Authored-By: Charon <charon@lethean.io>
Comment on line 126 showed `err` but implementation used `verifyError`,
violating AX Principle 2 (comment must match usage example) and Principle 1
(err is the RFC-sanctioned idiomatic name for local error variables).
Co-Authored-By: Charon <charon@lethean.io>
Principle 2: comments show HOW with real values, not WHAT the type is.
The old comment restated the struct name; the new block demonstrates the
full setup sequence an agent needs to wire a Worker.
Co-Authored-By: Charon <charon@lethean.io>
Comment example used log.Println (banned import) as a usage pattern.
Replaced with logging.Info to align with AX Principle 2 (comments
as valid usage examples that match ecosystem conventions).
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 1: predictable names over short names. The abbreviated
struct field `dedup` requires a reader to mentally expand it; the
full name `deduplicator` is self-describing.
Co-Authored-By: Charon <charon@lethean.io>
Per AX Principle 2, comments must show concrete usage, not describe intent.
The `default:` branch comment now demonstrates the write calls rather than
explaining what they protect against.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 1 — predictable names over short names. `dn` is an
opaque abbreviation for a *datanode.DataNode; `dataNode` conveys
the type at a glance without requiring context lookup.
Co-Authored-By: Charon <charon@lethean.io>
Test names lacked the AX-required suffix pattern (RFC-025 §10 test naming).
Renamed all 8 functions to TestErrors_* with _Good, _Bad, and _Ugly suffixes.
Also renamed loop variables from tt to c (predictable name, AX principle 1).
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments that restate what the surrounding code already
says are noise. The inline comment inside TestReader_ReadAndVerify_Ugly
duplicated the usage example already present in the function docstring.
Co-Authored-By: Charon <charon@lethean.io>
The default switch-case comment in ReadAndVerify restated the three
lines immediately following it verbatim, violating AX Principle 2
(comments as usage examples, not code descriptions). Replaced with a
single line explaining the security intent of the behaviour.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 10 requires all three categories (Good, Bad, Ugly) for
every test function. TestWorker_HandlePing had only Good; add Bad
(invalid payload) and Ugly (zero SentAt edge case).
Co-Authored-By: Charon <charon@lethean.io>
dbCtx→databaseContext, dbCancel→databaseCancel, dbPoint→databasePoint
in collectSingleMinerStats per AX principle 1 (predictable names over short names).
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2 — comments must show concrete usage, not restate the
type name. TaskFunc, SupervisedTask, TaskSupervisor, and TaskStatus
all had prose descriptions that added zero information over the
signature. Replaced with call-site examples.
Co-Authored-By: Charon <charon@lethean.io>
tagByte described the storage type (a byte), not the purpose. All
constants in the package use Tag* naming (TagVersion, TagPayload, etc.)
so the loop variable should match: tagType aligns with the domain
vocabulary and satisfies AX Principle 1 (predictable names over short
names).
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments must show HOW with real values, not restate what
the type signature already says. "returns sensible defaults" adds zero
information — the concrete call pattern teaches agents exactly how to use it.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments must be usage examples, not prose descriptions.
"Corrupt the last byte of the payload/frame" restates what the adjacent
code does rather than demonstrating a call with concrete values.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2: comments must show concrete usage, not restate the type
signature in prose. StatsCollector and HTTPStatsConfig had three lines of
descriptive prose that added no information an agent couldn't infer from
the names alone.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 1: predictable names over short names. The comment example
used `n` which requires context to understand; `connectionCount` is
self-documenting.
Co-Authored-By: Charon <charon@lethean.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>