Commit graph

75 commits

Author SHA1 Message Date
Claude
28dfe3f31e
ax(node): replace prose comment with usage examples on IsProtocolVersionSupported
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:56:12 +01:00
Claude
0979fd1aea
ax(node): replace prose comment with usage example on GetRemoteStats
Some checks failed
Security Scan / security (push) Successful in 31s
Test / test (push) Has been cancelled
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 08:54:44 +01:00
Claude
df8d7189d8
ax(node): replace prose description with usage example on CreateProfileBundle
AX Principle 2: comments show HOW with real values, not WHAT the signature
already says. The prose "creates an encrypted bundle containing a mining
profile" restates the type signature — deleted in favour of a concrete call.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:52:42 +01:00
Claude
d886b3905c
ax(node): replace prose comments with usage examples on NewMessage and Reply
AX Principle 2: comments must show HOW with real values, not restate the
type signature in prose. The previous comments added zero information.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:50:39 +01:00
Claude
fbdb14e98f
ax(node): rename TestNewWorker to follow AX test naming convention
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX principle requires TestFilename_Function_{Good,Bad,Ugly}.
TestNewWorker → TestWorker_NewWorker_Good.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:48:41 +01:00
Claude
1ff90ba170
ax(node): replace prose comments with usage examples on PeerRegistry auth methods
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
SetAuthMode, GetAuthMode, AllowPublicKey, and RevokePublicKey all had
comments that restated the function signature rather than showing concrete
usage. Replaced with call-site examples per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:47:20 +01:00
Claude
4c355049e7
ax(node): remove dangling prose comment in peer.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Line 715 contained "// Example usage inside a connection handler" with no
code following it — a prose description stub with no usage example. This
violates AX Principle 2 (comments must show concrete usage with real values,
not describe intent in prose).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:44:40 +01:00
Claude
c7a3f553e9
ax(node): replace prose comment with usage example on calculateChecksum
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.
Replace with a concrete usage example showing how the return value is used.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:43:24 +01:00
Claude
8f7b6892ee
ax(node): replace prose comment on GetPeer with usage example
AX Principle 2: comments show HOW with real values, not WHAT the
signature already states. "GetPeer returns a peer by ID" restates
the function name — replaced with a concrete call pattern.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:40:30 +01:00
Claude
b18aa741ba
ax(node): replace prose comment with usage example on IsProtocolError
AX Principle 2 — comments show HOW with real values, not what the
signature already says. "returns true if the error is a ProtocolError"
restates the type; a concrete call pattern teaches agents how to use it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:37:09 +01:00
Claude
92e8da2843
ax(node): rename TestConvenienceFunctions to AX-compliant TestProtocol_DefaultHandler_Good
TestConvenienceFunctions violated AX Principle 1 (predictable names — "ConvenienceFunctions"
is a vague label, not a description of what is tested) and Principle 10 (test naming must
follow TestFilename_Function_{Good,Bad,Ugly}).

Renamed to TestProtocol_DefaultHandler_Good, added a usage-example doc comment per
Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:35:17 +01:00
Claude
0c69d095de
ax(node): replace prose comment with usage example, rename ch to channel
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1: ch is an opaque abbreviation for a response channel — rename
to channel so the variable's role is predictable without tracing the map type.

AX Principle 2: "handleResponse processes incoming messages…" restates the
signature. Replaced with a concrete usage example showing how it is wired.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:32:39 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
45a1dcc987
ax(node): replace prose comment on NewMessageDeduplicator 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:54:06 +01:00
Claude
6508b92876
ax(node): replace prose comment on Count with usage example
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 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>
2026-04-02 07:52:08 +01:00
Claude
4a586f4dad
ax(node): replace prose comment on GetAllStats with usage example
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>
2026-04-02 07:50:36 +01:00
Claude
c0856259cd
ax(node): rename abbreviated mu/wg to resultsMutex/waitGroup in GetAllStats
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
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>
2026-04-02 07:49:17 +01:00
Claude
873ccaee7b
ax(node): replace prose ValidateResponse 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:47:37 +01:00
Claude
05a267e051
ax(node): replace prose comment with usage example on SelectOptimalPeer
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:46:36 +01:00
Claude
725960d915
ax(node): rename respCh to responseChannel in sendRequest
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.
`respCh` is an abbreviated compound; `responseChannel` is
unambiguous without context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:45:03 +01:00
Claude
a4c4d64a98
ax(node): replace prose comment with usage example on safeKeyPrefix
AX Principle 2: comments show HOW with real values, not WHAT the signature says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:42:21 +01:00
Claude
c85217dfca
ax(node): rename rtt to roundTripTime in PingPeer
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle #1: names must not require a comment to explain.
The comment "Calculate round-trip time" existed solely to decode
the abbreviation rtt — proof the name was too short.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:41:15 +01:00
Claude
88e6910e3a
ax(node): replace prose comments with usage examples on SetMinerManager and SetProfileManager
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:37:54 +01:00
Claude
44811e84fd
ax(node): rename geoWeight to geographicWeight for AX principle 1
geo is an abbreviation that requires domain knowledge to parse;
geographicWeight makes the dimension self-describing.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:35:37 +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
7cb8487475
ax(node): rename loop variable v to supported in IsProtocolVersionSupported
Single-letter v is not AX-exempt — only i (index) is allowed in range loops.
The element variable names the thing being iterated, so: supported.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:31:27 +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
e707710e9d
ax(node): replace NewWorker prose comment with usage example
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:26:50 +01:00
Claude
b93b19fac7
ax(node): replace prose comment on NewController with usage example
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 07:25:42 +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
Claude
140f038f37
chore: migrate module path from github.com to forge.lthn.ai
Some checks failed
E2E Tests / E2E Tests (push) Failing after 1m23s
Tests / Go Tests (push) Failing after 39s
Desktop Release / Build linux (push) Failing after 46s
Release / Test (push) Failing after 2s
Tests / C++ Tests (push) Failing after 1m12s
Release / Release (push) Has been cancelled
Desktop Release / Build darwin (push) Has been cancelled
Desktop Release / Build windows (push) Has been cancelled
Desktop Release / Create Release (push) Has been cancelled
Move module declaration and all internal imports from
github.com/Snider/Mining to forge.lthn.ai/Snider/Mining. Also updates
Borg, Enchantrix, and Poindexter dependency paths to forge.lthn.ai.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 21:39:01 +00:00
copilot-swe-agent[bot]
3aea1d7d1a Fix test failures and unused imports after combining PRs
Co-authored-by: Snider <631881+Snider@users.noreply.github.com>
2026-02-02 06:12:37 +00:00
google-labs-jules[bot]
1f464a62f1 Implement STIM bundle decryption and installation
- Updated `Worker.handleDeploy` to handle STIM bundles using `ExtractProfileBundle` and `ExtractMinerBundle`.
- Used `PeerConnection.SharedSecret` as the password for decryption.
- Implemented logic for `BundleProfile`, `BundleMiner`, and `BundleFull`.
- Fixed broken files `pkg/node/dispatcher.go` and `pkg/node/peer.go` to ensure compilation and testing.
- Updated tests in `pkg/node/worker_test.go` and added coverage for deployment logic.
2026-02-02 06:07:05 +00:00