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>
fmt is a banned import (AX §banned-imports). miner_factory.go used
fmt.Errorf for the unsupported-miner error path; the package already
provides ErrUnsupportedMiner() in errors.go, so use that instead and
drop the fmt import entirely.
Co-Authored-By: Charon <charon@lethean.io>
All 12 exported functions in metrics.go had comments that restated their
signatures in prose (e.g. "records a miner start event") instead of
showing concrete call examples. Replaced with AX-compliant usage examples
per RFC-025 principle 2 (Comments as Usage Examples).
Co-Authored-By: Charon <charon@lethean.io>
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>
AX principle 1: predictable names over short names.
cl abbreviates rateLimitClient; rename to client throughout Middleware
and cleanup for semantic clarity.
Co-Authored-By: Charon <charon@lethean.io>
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>
Single-letter w is not in the AX exception list (only i, _, t, c are
permitted). Replace with the full predictable name writer per AX principle 1.
Co-Authored-By: Virgil <virgil@lethean.io>
All public function comments restated the signature (AX-2 violation).
Replace each with a concrete call example showing real values.
Co-Authored-By: Charon <charon@lethean.io>
Seven MiningError method comments restated the function signature verbatim
(AX principle 2 violation). Deleted all seven and replaced NewMiningError's
comment with a concrete call-site example per the RFC rule: if a comment
restates what the type signature already says, delete it.
Co-Authored-By: Charon <charon@lethean.io>
`minerCfg` is an abbreviated name for `MinerAutostartConfig` loop
variables. Renamed to `autostartEntry` across three range loops in
manager.go for AX Principle 1 compliance (predictable names over
short names).
Co-Authored-By: Charon <charon@lethean.io>
geo is an abbreviation that requires domain knowledge to parse;
geographicWeight makes the dimension self-describing.
Co-Authored-By: Charon <charon@lethean.io>
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>
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>
UEPSHeader's type-level comment restated the name in prose; replaced with
a concrete struct-literal example (AX principle 2). Field inline comments
updated from vague labels to descriptive value-context notes.
Co-Authored-By: Charon <charon@lethean.io>
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>
AX Principle 1: predictable names over short names.
`dbCfg` abbreviates both the `db` prefix and `Cfg` suffix — both banned
by the AX naming rules. `databaseConfiguration` is unambiguous.
Co-Authored-By: Charon <charon@lethean.io>
NewBuilder, MarshalAndSign, ReadAndVerify, PacketBuilder, and ParsedPacket
comments now show concrete call-site examples with real values instead of
restating what the type signatures already convey.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 1 — predictable names over short names. The Manager struct
fields dbEnabled and dbRetention used the db abbreviation which requires
context to decode. Renamed to databaseEnabled and databaseRetention across
manager.go and the single service.go callsite. No behaviour change.
Co-Authored-By: Charon <charon@lethean.io>
Abbreviated constant names violated AX Principle 1 (Predictable Names Over
Short Names). The struct fields already used CurrentLayer/TargetLayer — the
constants now match, eliminating the inconsistency.
Co-Authored-By: Charon <charon@lethean.io>
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>
- 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.
- Skip tests that attempt to start miner processes (`StartMiner`, `StopMiner`) to avoid resource usage and flakiness in CI.
- Add `TestXMRigMiner_CheckInstallation` to verify binary detection and version parsing using a dummy script that prints version info.
- Refactor `TestGetMiner_Good` and `TestListMiners_Good` to manually inject miner instances, preserving coverage for retrieval logic without starting processes.
- Fix UI test compilation by updating imports and mocks.
- Fix panic in `TestStopMiner_Good` by checking errors (though now skipped).