Commit graph

569 commits

Author SHA1 Message Date
Claude
8a23b0efca
ax(database): add usage-example comment to GetHashrateStats
GetHashrateStats had no comment at all — bare exported function.
AX Principle 2 requires comments as usage examples, not prose.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:17:46 +01:00
Claude
5bfffbdec9
ax(logging): replace prose comment on WithComponent with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:16:29 +01:00
Claude
fbe40d2c53
ax(database): rename TestInitialize to follow TestFilename_Function_Good convention
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 14:16:25 +01:00
Claude
4afc61cbbb
ax(mining): rename cfg to configuration in DatabaseConfig field comments
AX Principle 1: predictable names over short names.
Usage-example comments inside DatabaseConfig used the abbreviation
cfg; renamed to configuration so the inline examples teach the full,
unambiguous name.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:16:17 +01:00
Claude
a6106461b8
ax(ueps): replace prose comment with usage example in ReadAndVerify
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 code does.
The inline prose "All tags except TagHMAC contribute..." restated logic already
visible in the surrounding code. Replaced with a concrete call sequence showing
the exact buffer writes performed for each non-HMAC tag.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:16:08 +01:00
Claude
9280527f19
ax(node): rename stopChan to stopChannel in PeerRegistry
'Chan' is an abbreviation; AX Principle 1 requires predictable names
over short names. stopChannel is unambiguous without a comment.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:16:07 +01:00
Claude
5b7c84142e
ax(logging): replace signature-restatement comment with usage example on SetLevel
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 14:15:18 +01:00
Claude
02ffd28eaf
ax(database): replace signature-restatement comment with usage example on HashrateStats
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:15:15 +01:00
Claude
89e70a4449
ax(ueps): eliminate duplicated HMAC buffer writes in ReadAndVerify switch
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The switch in ReadAndVerify duplicated the same three hmacInputBuffer.WriteByte/Write
calls across five cases plus default. Extracted to a single conditional after the switch:
all tags except TagHMAC feed the authenticated input buffer. Behaviour is identical;
declarative intent is now clear (AX principle 5 — declarative over imperative).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:15:06 +01:00
Claude
089da5fc21
ax(mining): replace prose comment with usage example on parseVersion
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
function does (which the signature already says).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:14:41 +01:00
Claude
4b6ca745f5
ax(node): rename Transport receiver from t to transport
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter receiver `t` violates AX Principle 1 (predictable names
over short names). All 15 Transport methods now use `transport` as the
receiver name for unambiguous semantic navigation.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:14:26 +01:00
Claude
df3a641f5f
ax(logging): replace prose comments with usage examples on global functions
AX Principle 2 — global convenience functions had comments restating the
signature ("logs a debug message using the global logger") rather than
showing concrete calls with realistic values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:14:21 +01:00
Claude
18ac5e1c94
ax(database): replace prose comment with usage example on GetHashrateHistory
AX Principle 2 — comments must show a concrete call, not restate the signature.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:14:18 +01:00
Claude
a86811220e
ax(mining): rename abbreviated locals nm/pr to nodeManager/peerRegistry in NewNodeService
Some checks failed
Security Scan / security (push) Successful in 28s
Test / test (push) Has been cancelled
AX Principle 1: predictable names over short names. nm and pr require
mental mapping to understand their purpose; nodeManager and peerRegistry
are self-documenting at the call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:13:17 +01:00
Claude
7d6d00a0e6
ax(logging): replace prose comment on New with usage example
AX Principle 2: comments must show concrete usage, not restate the
function name. "New creates a new Logger with the given configuration"
restated the signature — replaced with a callable example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:13:04 +01:00
Claude
0f2c25f7ef
ax(database): replace prose comment on Initialize with usage example
AX Principle 2: comments must show concrete usage, not restate the
function name. "Initialize opens the database connection and creates
tables" restated the signature — replaced with a callable example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:13:01 +01:00
Claude
f8d3ee8c98
ax(ueps): name magic secret literals in NewPacketBuilder tests
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
TestPacket_NewPacketBuilder_Bad and _Ugly used inline []byte("secret")
literals; extracted to sharedSecret variable per AX Principle 1
(predictable names over magic literals).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:12:18 +01:00
Claude
9076b77596
ax(mining): replace prose comments with usage examples on HTTP client accessors
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 2: comments that restate the signature add zero information.
Show a concrete call with realistic values instead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:11:58 +01:00
Claude
230c07adf3
ax(logging): rename globalMu/sb to globalMutex/builder
Abbreviated names `globalMu` and `sb` require a comment to understand
their purpose, violating AX Principle 1 (Predictable Names Over Short
Names). Renamed `globalMu` to `globalMutex` and `sb` to `builder`
throughout logger.go.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:11:47 +01:00
Claude
036819e4eb
ax(database): rename db/dbMu to globalDatabase/databaseMutex
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Abbreviated names `db` and `dbMu` require a comment to understand their
scope and purpose, violating AX Principle 1 (Predictable Names Over Short
Names). Renamed to `globalDatabase` and `databaseMutex` throughout all
source and test files.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:11:10 +01:00
Claude
71292ccdc8
ax(mining): remove banned errors import from errors_test.go
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Replace errors.New() with ErrInternal()/ErrTimeout() and errors.Unwrap(err)
with err.Unwrap() — the MiningError type provides both without the banned import.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:10:49 +01:00
Claude
fc7a1a2147
ax(node): replace banned path/filepath import with path in peer registry
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 14:10:22 +01:00
Claude
3e2f8f9f15
ax(mining): replace prose comment on ServiceStartup with usage example
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
AX Principle 2 — comments show HOW with real values, not describe WHAT
the function signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:09:37 +01:00
Claude
74f310b10c
ax(ueps): rename reader to frameReader in ReadAndVerify tests
AX Principle 1 — predictable names over short names.
The variable reader is ambiguous; frameReader states
exactly what is being read.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:09:28 +01:00
Claude
b404f622bb
ax(node): add Good and Ugly test cases for HandleStartMiner, HandleStopMiner, and HandleGetLogs
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX principle: all three categories (Good, Bad, Ugly) are mandatory per
TestFilename_Function_{Good,Bad,Ugly} convention. Three handler functions
had only _Bad coverage; this pass fills the gap.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:08:49 +01:00
Claude
679a3c2177
ax(mining): replace prose comment on LogBuffer 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 type name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:08:10 +01:00
Claude
35342e2349
ax(ueps): align comment examples with predictable variable names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Use sharedSecret in doc-comment examples to match actual test body
variable names — resolves AX principle 1+2 violation where comment
examples used the abbreviated form secret while code used sharedSecret.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:07:29 +01:00
Claude
07281659da
ax(mining): replace prose comment with usage example on ReduceHashrateHistory
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 concrete values, not restate
what the signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:06:30 +01:00
Claude
0ac701daea
ax(node): rename PeerRegistry.path to peersFilePath for predictable naming
Some checks failed
Security Scan / security (push) Has been cancelled
Test / test (push) Has been cancelled
AX Principle 1: predictable names over short names. The field `path` on
PeerRegistry is ambiguous — it could be any path. `peersFilePath` is
self-describing and removes the need for a comment to explain its purpose.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:05:02 +01:00
Claude
fac2563aa2
ax(mining): replace prose comment with usage example on ShutdownTimeout
AX Principle 2 — comments as usage examples, not prose descriptions.
The previous comment restated what the constant name already communicates.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:05:00 +01:00
Claude
8ce93adf11
ax(mining): rename Container.mu to mutex (AX Principle 1)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
`mu` is an abbreviation that requires context to understand. AX Principle 1
mandates predictable names over short names — `mutex` is unambiguous.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:03:42 +01:00
Claude
fb998ce2df
ax(node): replace banned path/filepath with path in worker.go
worker.go imported path/filepath (banned import) solely for two
filepath.Join calls building the miner install directory path.
Replaced with path.Join from the stdlib path package which is
not banned and behaves identically on Linux for absolute paths.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:03:13 +01:00
Claude
6df2566acb
ax(ueps): include method name in sentinelError test names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestFilename_Function_{Good,Bad,Ugly} requires the function being
tested, not just the type name. sentinelError tests exercise the
.Error() method so names must be TestPacket_sentinelError_Error_*.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:02:58 +01:00
Claude
0fe74ae8a6
ax(mining): replace pm abbreviation with profileManager in usage-example comments
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
AX Principle 1 (predictable names over short names): usage-example comments
in profile_manager.go used the abbreviated `pm` receiver throughout, while all
production code uses the full `profileManager` name. Comments are teaching
material — agents and readers learn from them. Aligning examples with the actual
variable name removes the abbreviation mapping overhead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:02:17 +01:00
Claude
68ee594149
ax(node): replace prose comment on ProfileManager with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Principle 2 (Comments as Usage Examples): the ProfileManager interface
comment described what the interface was rather than showing how to use it.
Replaced with concrete call examples for GetProfile and SaveProfile.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:02:05 +01:00
Claude
61c45810ba
ax(ueps): rename header to packetHeader for AX Principle 1 compliance
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Generic name `header` replaced with `packetHeader` throughout ReadAndVerify
to satisfy AX predictable-names-over-short-names; the name now conveys what
is being built without requiring context from the surrounding function.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:01:08 +01:00
Claude
c03b040240
ax(node): replace prose comment on GracefulClose with usage examples
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 prose descriptions.
The previous comment restated what the function name already conveyed.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:00:25 +01:00
Claude
a97f93b919
ax(mining): replace banned errors import with domain error constructors
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
xmrig_stats.go and ttminer_stats.go used errors.New() despite the
package providing ErrMinerNotRunning() and ErrInternal() for exactly
these cases. Removes banned errors import from both files.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 14:00:08 +01:00
Claude
7f02b47445
ax(ueps): rename tagLengthByte to tagLength — type suffix violates AX Principle 1
Variable name tagLengthByte encoded its type (byte) rather than its role
(the length field of a TLV record). AX Principle 1: names must be semantic,
not type-annotated. tagLength is unambiguous without the redundant Byte suffix.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:59:57 +01:00
Claude
7a121b7d18
ax(mining): rename mu to mutex in BaseMiner and LogBuffer (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 13:59:06 +01:00
Claude
316049d3ae
ax(ueps): make Bad test comment a self-contained usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestReader_ReadAndVerify_Bad referenced `frame` without defining it in
the comment block, leaving an agent without enough context to understand
the setup. Replace with a complete, standalone snippet showing frame
construction, corruption, and the expected error outcome.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:58:30 +01:00
Claude
98d34ffd07
ax(node): replace banned strings import with bytes.HasPrefix in bundle.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
The strings package is banned per AX conventions. Both HasPrefix calls in
extractTarball now use bytes.HasPrefix with the bytes package already imported.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:58:05 +01:00
Claude
0ffae0c646
ax(mining): rename configMu to configMutex in config_manager (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 13:57:26 +01:00
Claude
6149d7b283
ax(mining): rename mu to mutex in EventHub for AX Principle 1 compliance
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Abbreviated field name `mu` replaced with `mutex` throughout EventHub
to satisfy the predictable-names-over-short-names rule (RFC-025 §1).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:55:00 +01:00
Claude
4b8271647a
ax(node): replace prose MinerInstance comment with usage example
AX Principle 2: comments show HOW with real values, not restate
what the type signature already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:54:44 +01:00
Claude
be6f915ac5
ax(ueps): rename tagValueLength to tagLengthByte to signal byte type
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Variable named tagValueLength implied int semantics but held a byte
value from ReadByte(); AX Principle 1 requires names that are
unambiguous without comments — tagLengthByte makes the type explicit
and the int(tagLengthByte) cast at make() call site clarifies the
byte→int conversion for agent readers.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:53:22 +01:00
Claude
311e457e35
ax(node): rename PeerRegistry receiver r to registry
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 1 — predictable names over short names.
The receiver `r` on PeerRegistry is a single-letter abbreviation;
all 29 methods now use `registry` for consistency with the rest of
the node package (controller, worker, transport all use full names).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:52:26 +01:00
Claude
ee8b3e6499
ax(mining): rename receiver s to supervisor on TaskSupervisor (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 13:50:53 +01:00
Claude
22b6e8ace6
ax(node): replace prose comment with usage example on createTarball
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. The previous comment restated the function
signature in prose; replaced with a concrete call showing filename/
content pairs.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:49:16 +01:00
Claude
b55b2dd945
ax(mining): replace prose comment on Stop with usage example
AX Principle 2 — comments show HOW with real values, not WHAT the
signature already says. "Stop gracefully stops the service" restates
the name; replaced with a concrete call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:48:45 +01:00