Commit graph

15 commits

Author SHA1 Message Date
Claude
8695098988
ax(node): rename body to requestBody in lethean.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 17:47:53 +01:00
Claude
882dff4afc
ax(node): replace banned encoding/json import with package UnmarshalJSON wrapper in lethean.go
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 17:24:46 +01:00
Claude
d5d60d39e1
ax(node): rename ChainInfo.Aliases to AliasCount for type clarity
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The field Aliases int was ambiguous — agents and readers expect Aliases
to be a slice, not a count. AliasCount makes the int type self-evident
without requiring a comment (AX Principle 1: predictable names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 16:15:07 +01:00
Claude
22c52c0b70
ax(node): replace prose comment with usage example on chain constants
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Failing after 32s
LetheanDefaults comment restated what the constant block name already says (AX
Principle 2). Replaced with concrete call examples showing GetChainInfo and
DiscoverPools usage against both daemon endpoints.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:35:46 +01:00
Claude
5aa17421f6
ax(node): rename vague local variables in lethean.go to predictable names
`result` → `rpcResponse` in GetChainInfo, DiscoverPools, DiscoverGateways.
`parsed` → `commentFields` at call sites; `result`/`part` → `fields`/`segment`
in parseComment. Applies AX Principle 1: predictable names over short names.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:27:25 +01:00
Claude
96a450eff5
ax(node): remove banned fmt import from lethean.go
Replace fmt.Sprintf endpoint construction with string concatenation
and return errors directly, eliminating the banned fmt import.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:25:41 +01:00
Claude
e08d475c13
ax(node): expand abbreviated loop variable in DiscoverGateways usage example
Comment used `gw` (AX-1: predictable names over short names).
Expanded to `gateway` so the usage example matches what code should look like.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:07:40 +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
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
6aea40d90c
ax(node): replace GoDoc prose+code-block comments with AX usage examples in lethean.go
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>
2026-04-02 10:36:31 +01:00
Claude
bf44c296d9
ax(node): add usage example comment to parseComment
AX-2: every function must show a concrete call with real values, not
prose. parseComment had no comment at all — added three-line example
showing input string, key lookup, and expected return values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:23:23 +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
857c5f0ae3
ax(node): rename idx to separatorIndex in parseComment
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. idx is an
abbreviation requiring a mental mapping; separatorIndex names the
variable by its role (the index of the = separator character).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:33:01 +01:00
Claude
7ee91842d7
ax(node): rename loop variable a to alias in DiscoverPools and DiscoverGateways
AX Principle 1 — predictable names over short names. The single-letter `a`
requires context to understand; `alias` is self-describing at every read site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:29:22 +01:00
Claude
7c6645fbeb
feat(node): add Lethean chain discovery for mining fleet
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Chain integration for P2P mining nodes:
- GetChainInfo — query daemon for height, aliases, sync status
- DiscoverPools — find pool aliases from chain (cap=pool)
- DiscoverGateways — find gateway nodes from chain
- parseComment — v=lthn1 comment parser

Constants: testnet/mainnet daemon URLs and pool endpoints.
4/4 tests passing.

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