Commit graph

408 commits

Author SHA1 Message Date
Claude
4e10e20a6b
ax(node): replace prose comment with usage example on GetConnection
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
AX Principle 2 — comments must show HOW with real values, not restate
what the signature already says. The old comment described the return
value in prose; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:31:36 +01:00
Claude
86eff8dfc2
ax(mining): replace prose comments with usage examples on CircuitState
AX Principle 2: comments must show HOW with real values, not restate
what the type signature already says. The four prose comments on
CircuitState and its constants are replaced with a single usage-example
block that shows all three states in context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:31:32 +01:00
Claude
02a68cc275
ax(mining): rename auth_test.go functions to TestAuth_Function_{Good,Bad,Ugly} convention
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:29:21 +01:00
Claude
0a0751e2e0
ax(node): rename dir to directoryPath (AX Principle 1)
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Short variable name `dir` violated predictable-names-over-short-names.
Renamed to `directoryPath` in savePrivateKey, saveIdentity, and saveNow.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:29:01 +01:00
Claude
7a007c7fb8
ax(ueps): remove commented-out dead error variables
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Commented-out var declarations are not usage examples — they are dead
code that adds noise. AX Principle 2 requires comments to show concrete
usage, not linger as disabled code.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:28:39 +01:00
Claude
d400946352
ax(node): rename u to peerURL in Transport.Connect
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter variable name violates AX Principle 1 (predictable names
over short names). peerURL is self-describing without requiring context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:26:37 +01:00
Claude
d4cf8e5e3d
ax(ueps): rename packetError receiver from abbreviated packetErr to e
packetErr is a shortened form of packetError, violating AX Principle 1
(predictable names over short names). Single-letter e is explicitly
permitted for value receivers per RFC-CORE-008-AGENT-EXPERIENCE.md.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:26:35 +01:00
Claude
5d2917269b
ax(mining): replace prose comment with usage example on ContainerConfig
AX Principle 2: comments must show concrete usage, not restate the type name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:26:24 +01:00
Claude
a10adc881b
ax(node): rename message_test.go functions to TestMessage_Function_{Good,Bad,Ugly}
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 10 requires test names to follow TestFilename_Function_{Good,Bad,Ugly}.
message_test.go used bare names (TestNewMessage, TestMessageReply, etc.) with no
suffix. Added Bad/Ugly cases for ParsePayload (nil payload, malformed JSON).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:25:07 +01:00
Claude
c04bf6ab09
ax(ueps): rename single-letter receiver e to packetErr in packetError.Error
RFC-025 Principle 1: single-letter names are only permitted for i (range),
_ (discards), t (tests), and c (*core.Core). The receiver variable e is
not in the allowed list — packetErr is predictable and removes the mapping
overhead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:24:54 +01:00
Claude
194c45a98b
ax(mining): replace prose struct comment with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
MiningError had "is a structured error type" — restates the declaration.
AX principle 2: comments show HOW with real values, not WHAT the signature says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:24:33 +01:00
Claude
2b193cfc47
ax(ueps): fix Version field comment to use usage-example style
Some checks failed
Security Scan / security (push) Successful in 35s
Test / test (push) Has been cancelled
AX Principle 2: comments show HOW with real values, not prose descriptions.
`// 0x09 = IPv9` described the constant; `// header.Version = 0x09 // IPv9`
shows the assignment as used, matching all other UEPSHeader field comments.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:22:15 +01:00
Claude
3a690ee485
ax(node): rename nm to manager in NewNodeManagerWithPaths for predictable naming
AX Principle 1 — nm abbreviates NodeManager, requiring mapping overhead.
Rename to manager and update the NewNodeManager usage-example comment to match.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:21:55 +01:00
Claude
ab7ccdda8a
ax(mining): replace prose comments with usage examples in profile_manager
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
loadProfiles and saveProfiles had comments that restated their function
names in prose form. AX Principle 2 requires comments to show concrete
usage examples, not descriptions. Replace both with call-site examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:21:28 +01:00
Claude
6f235183ff
ax(mining): replace prose comment with usage example on emitEvent
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 30s
AX Principle 2: comments show HOW with real values, not WHAT in prose.
The emitEvent comment restated the function name rather than demonstrating
a concrete call.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:20:04 +01:00
Claude
a6eb29a486
ax(node): replace prose comment with usage example on extractTarball
RFC-025 Principle 2 — comments must show a concrete call with realistic
values, not restate what the signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:20:01 +01:00
Claude
25557e0208
ax(ueps): replace placeholder packetError comment with concrete usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The comment on `type packetError string` used abstract placeholder names
(`errMyError`, `"my error message"`) instead of realistic domain values.
AX Principle 2 requires concrete usage examples, not documentation templates.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:19:18 +01:00
Claude
cb02cdb6b8
ax(node): replace prose comment with usage example on handleWSUpgrade
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
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>
2026-04-02 11:18:29 +01:00
Claude
9e4bb376e8
ax(mining): replace prose struct-field comments with usage examples
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
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>
2026-04-02 11:17:57 +01:00
Claude
b8d3dbf0c9
ax(ueps): use concrete value 0x09 in writeTLV usage-example comment
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 41s
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>
2026-04-02 11:16:00 +01:00
Claude
ceab3960bc
ax(mining): replace prose comment on NewTTMiner with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 2: comments must show concrete usage, not restate the signature.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:14:13 +01:00
Claude
fd1aed63fe
ax(node): replace prose comment on NewErrorMessage with usage example
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 type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:13:41 +01:00
Claude
10241f5803
ax(node): rename Caps to Capabilities on PoolGateway struct
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
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>
2026-04-02 11:11:41 +01:00
Claude
14aab01af9
ax(mining): replace prose comment with usage example on syncMinersConfig
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
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>
2026-04-02 11:11:07 +01:00
Claude
b846e1f895
ax(ueps): rename tlvError to packetError for AX Principle 1 compliance
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>
2026-04-02 11:10:44 +01:00
Claude
e0893bd299
ax(node): replace prose comment on NewTransport with usage example
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
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>
2026-04-02 11:08:21 +01:00
Claude
00bf5a8446
ax(mining): replace prose comment on Record with usage example
RFC-025 §2: comments show HOW with real values, not restate the signature.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:08:16 +01:00
Claude
5ff08bfbd8
ax(ueps): align verifyError variable name with idiomatic err convention
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
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>
2026-04-02 11:06:48 +01:00
Claude
58e5968b5f
ax(mining): replace prose comment on ManagerInterface with usage example
AX Principle 2 — comments show HOW with real values, not restate what the type name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:06:14 +01:00
Claude
a8e962a4df
ax(node): replace prose Worker comment with usage example
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>
2026-04-02 11:06:08 +01:00
Claude
f15498756d
ax(mining): fix banned import in ListAvailableMiners usage example
Some checks failed
Security Scan / security (push) Successful in 44s
Test / test (push) Has been cancelled
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>
2026-04-02 11:03:57 +01:00
Claude
6d77de500d
ax(node): rename dedup field to deduplicator in Transport struct
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>
2026-04-02 11:03:44 +01:00
Claude
8d9606c2d8
ax(ueps): replace prose comment with usage example in ReadAndVerify default case
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>
2026-04-02 11:03:35 +01:00
Claude
51595300a2
ax(node): rename abbreviated dn to dataNode in CreateMinerBundle
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
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>
2026-04-02 11:02:28 +01:00
Claude
cf4d52a3b7
ax(mining): rename errors_test.go functions to TestErrors_Function_{Good,Bad,Ugly}
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
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>
2026-04-02 11:01:30 +01:00
Claude
5188cb617c
ax(ueps): remove redundant inline comment that restates the pre-function docstring
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
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>
2026-04-02 11:01:18 +01:00
Claude
b64ce31f69
ax(ueps): replace code-restatement comment with semantic explanation
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
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>
2026-04-02 10:58:52 +01:00
Claude
2a5a3d6393
ax(node): add missing Bad and Ugly test variants for HandlePing
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>
2026-04-02 10:58:46 +01:00
Claude
4ff92dec1a
ax(mining): expand abbreviated db variable names to full predictable names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
dbCtx→databaseContext, dbCancel→databaseCancel, dbPoint→databasePoint
in collectSingleMinerStats per AX principle 1 (predictable names over short names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:58:14 +01:00
Claude
8519413e22
ax(mining): replace prose comments with usage examples on supervisor types
Some checks failed
Security Scan / security (push) Successful in 30s
Test / test (push) Has been cancelled
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>
2026-04-02 10:56:11 +01:00
Claude
813cf2d632
ax(ueps): rename tagByte to tagType for semantic clarity
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
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>
2026-04-02 10:55:02 +01:00
Claude
871e6dd985
ax(node): replace prose comment on DefaultTransportConfig with usage example
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>
2026-04-02 10:55:02 +01:00
Claude
dd981edea9
ax(ueps): remove prose inline comments that restate code intent
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>
2026-04-02 10:55:00 +01:00
Claude
27f10dd252
ax(mining): replace prose comments with usage examples in StatsCollector
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 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>
2026-04-02 10:53:15 +01:00
Claude
e69816f978
ax(node): rename n to connectionCount in ConnectedPeers usage example
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>
2026-04-02 10:53:09 +01:00
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