Commit graph

565 commits

Author SHA1 Message Date
Claude
d812ad92de
ax(node): add Bad and Ugly test categories for TestIdentity_NodeManager
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX Principle 10 requires all three categories (Good, Bad, Ugly) per test
group. identity_test.go had TestIdentity_NodeManager_Good with no Bad or
Ugly counterparts. Adds error-path tests for non-writable paths and
uninitialised identity, plus edge cases for double-generation and
delete-before-generate.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:12:22 +01:00
Claude
15f45b9fbc
ax(mining): replace prose comments with usage examples in manager.go
initDatabase and startDBCleanup had comments that restated the function
name in prose — violating AX Principle 2 (comments as usage examples).
Replaced with concrete call-site examples showing caller context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:11:56 +01:00
Claude
9a3179ac6b
ax(ueps): assert sentinel error identity in writeTLV_Bad test
All checks were successful
Security Scan / security (push) Successful in 37s
Test / test (push) Successful in 4m27s
Comment promised errTLVValueTooLarge but test only checked err != nil.
AX Principle 2 requires comments to be accurate usage examples —
the comment implied sentinel identity so the assertion must verify it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:05:04 +01:00
Claude
bd11abb7df
ax(node): replace prose constant comment with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
ChallengeSize comment restated the name ("is the size of the challenge
in bytes") — violating AX Principle 2. Replace with a concrete usage
example showing how the constant is used at call sites.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:04:30 +01:00
Claude
bde60612f1
ax(mining): rename CircuitBreaker.mu to mutex for AX Principle 1 compliance
`mu` is an abbreviation requiring context to interpret; `mutex` is
self-describing and matches the AX rule that names must not require
a comment to explain.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:04:26 +01:00
Claude
b53e5f2b19
ax(mining): rename RateLimiter.mu to mutex; fix prose comment to usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1 (predictable names): `mu` abbreviates `mutex` — rename to `mutex`.
AX Principle 2 (comments as usage examples): struct doc was prose ("provides token
bucket rate limiting per IP address") — replace with concrete call examples.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:02:14 +01:00
Claude
3565479521
ax(ueps): replace variable reference with concrete value in NewPacketBuilder comment
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX principle 2 requires comments to show usage with real values. The
MarshalAndSign call in the NewPacketBuilder doc comment used a variable
name (sharedSecret) instead of a concrete literal.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:02:01 +01:00
Claude
bf3b6c4b03
ax(node): replace prose constant comment with usage example
saveDebounceInterval had a description comment ("the minimum time between
disk writes") which restates what the name already says. Replaced with a
usage example showing the call site, per AX Principle 2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:01:32 +01:00
Claude
6cc373051f
ax(ueps): fix misleading errIntegrityViolation comment and message
All checks were successful
Security Scan / security (push) Successful in 35s
Test / test (push) Successful in 4m24s
The comment said "threat score incremented" and the error string said
"(ThreatScore +100)" but ReadAndVerify never mutates ThreatScore — it
only returns an error. Updated the comment to show the caller's
responsibility (header.ThreatScore += 100) and removed the parenthetical
from the error string.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:54:45 +01:00
Claude
ccc9450e6a
ax(mining): replace prose comment on CheckInstallation with usage example
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
AX principle 2: comments show HOW with real values, not WHAT the
function name already says. "verifies if the miner is installed
correctly" restated the signature; replaced with a concrete call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:53:44 +01:00
Claude
8b49b73a6f
ax(node): rename f to outputFile in extractTarball (AX Principle 1)
Single-letter variable f is not in the permitted set (i, _, t, c).
outputFile names the handle by what it contains.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:53:43 +01:00
Claude
e5cf3410f0
ax(mining): rename mining_test.go functions to TestFilename_Function_{Good,Bad,Ugly} convention
Some checks failed
Security Scan / security (push) Successful in 34s
Test / test (push) Has been cancelled
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:49:07 +01:00
Claude
d54d576546
ax(ueps): replace prose comment on ParsedPacket with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 requires comments to show concrete usage, not describe
behaviour. The old comment restated when fields are populated; the new
comment shows the dispatch call an agent would make after ReadAndVerify.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:48:43 +01:00
Claude
9394bbd768
ax(node): replace prose comments with usage examples on StreamBundle/ReadBundle
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 11:48:32 +01:00
Claude
f268b3990f
ax(node): rename abbreviated vars dirs/dir/mode to directories/directory/fileMode
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX-1: names that require a comment to explain are too short.
'dirs', 'dir', and 'mode' all needed the surrounding comment
to clarify their meaning; full names are self-documenting.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:46:49 +01:00
Claude
57253c4d7f
ax(mining): replace prose comment on InstallFromURL 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 11:46:38 +01:00
Claude
fe074699ad
ax(ueps): remove duplicate usage-example comment on ParsedPacket
AX Principle 2 — comments as usage examples, not restatements.
ParsedPacket carried the identical dispatch example twice: once above
the type and again above ReadAndVerify. The type-level copy added no
new information; replaced with a field-reference note that describes
what the struct exposes without duplicating the call-site example.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:46:29 +01:00
Claude
383c24d120
ax(mining): rename service_test.go functions to TestFilename_Function_Good convention
Some checks failed
Security Scan / security (push) Successful in 31s
Test / test (push) Has been cancelled
All 7 handler tests in service_test.go were missing the required
TestFilename_Function_{Good,Bad,Ugly} suffix mandated by AX Principle §Test Naming.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:44:00 +01:00
Claude
360c6c9d56
ax(node): rename mac to messageAuthCode in SignChallenge (AX Principle 1)
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:43:55 +01:00
Claude
559e63b0a9
ax(ueps): replace blank-identifier discards with realistic dispatch example
ParsedPacket comment used `_ = packet.Header.IntentID` — a discard
pattern that is not a realistic usage example (AX-2 violation). Replaced
with `dispatch(packet.Header.IntentID, packet.Header.ThreatScore, packet.Payload)`
to show how callers actually consume the parsed packet fields.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:43:53 +01:00
Claude
068f951477
ax(ueps): rename packetError receiver to packetErrorValue
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
Receiver name `packetError` shadowed the type name and violated AX
Principle 1 — names must be predictable and not require a comment
to explain. `packetErrorValue` is unambiguous as the bound value.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:42:34 +01:00
Claude
8ac3a08bf2
ax(mining): rename ProfileManager.mu to mutex for AX Principle 1 compliance
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Short name `mu` requires knowledge of Go convention to decode; `mutex`
is unambiguous and self-describing per predictable-names-over-short-names.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:41:45 +01:00
Claude
e9143e42b0
ax(node): replace prose comment on scheduleSave with usage example
AX Principle 2: comments show HOW with real values, not prose restating
what the name already says.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:41:43 +01:00
Claude
59e08e3352
ax(ueps): rename receiver packetErr to packetError for AX Principle 1
Some checks failed
Security Scan / security (push) Successful in 31s
Test / test (push) Has been cancelled
`packetErr` is an abbreviation of the full type name `packetError`.
AX Principle 1 requires predictable names over short names — receiver
renamed to the full type name to eliminate mapping overhead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:36:34 +01:00
Claude
c486e1fecb
ax(mining): rename MinerFactory.mu to mutex for AX principle 1 compliance
Some checks failed
Test / test (push) Waiting to run
Security Scan / security (push) Has been cancelled
`mu` requires context to understand — `mutex` is self-describing at a glance.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:36:19 +01:00
Claude
b15b1654cb
ax(node): expand abbreviated json tag ts to timestamp on Message struct
AX Principle 1 — predictable names over short names. The wire format
field "ts" requires a reader to guess its meaning; "timestamp" is
self-documenting and consistent with every other field on the struct.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:36:07 +01:00
Claude
109b9e190f
ax(mining): rename MinerFactory receiver f → factory for AX Principle 1
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter receiver `f` on *MinerFactory violates AX-025 § "Predictable
Names Over Short Names". Renamed to `factory` across all methods so the
receiver is self-describing at every call site.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:34:08 +01:00
Claude
04c05c43a7
ax(node): replace prose comment with usage example on NewNodeManagerWithPaths
Some checks are pending
Test / test (push) Waiting to run
Security Scan / security (push) Successful in 40s
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:33:27 +01:00
Claude
7921881ed6
ax(ueps): rename receiver e to packetErr for AX Principle 1 compliance
Single-letter receiver `e` is not in the AX-permitted list
(i, _, t, c). Renamed to `packetErr` for predictable naming.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:33:06 +01:00
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