Commit graph

25 commits

Author SHA1 Message Date
Claude
a565d77b7b
ax(ueps): remove prose step comments from ReadAndVerify per AX Principle 2
Internal numbered step comments (1. Read Tag, 2. Handle Payload Tag, etc.)
restate what the code does rather than showing concrete usage examples.
Per RFC-CORE-008 Principle 2: delete comments that restate what the code
already expresses; keep only usage examples with realistic values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:48:18 +01:00
Claude
64af8eb468
ax(ueps): remove superfluous payloadBytes intermediate variable
payload was declared via var at the top of ReadAndVerify; the inner
payloadBytes := io.ReadAll + payload = payloadBytes pattern introduced
an unnecessary name that added no semantic value. Assign directly to
the outer payload variable instead.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:35:35 +01:00
Claude
df80dbddb5
ax(ueps): rename remaining to payloadBytes for semantic clarity
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 1: names should convey semantic meaning, not implementation
perspective. `remaining` describes a buffer operation; `payloadBytes`
describes what the data IS — the packet payload content.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:32:37 +01:00
Claude
c7c2bd7df9
ax(ueps): rename tag to tagByte in ReadAndVerify loop (AX-1 predictable names)
`tag` is not in the accepted single-letter exception list (i, _, t, c).
`tagByte` is self-describing: the byte value of the TLV tag field.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:27:53 +01:00
Claude
db124cff82
ax(ueps): rename expectedMAC to expectedMessageAuthCode
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
MAC is an abbreviation requiring context; expectedMessageAuthCode matches
the established messageAuthCode pattern and is self-describing (AX §1).

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:23:29 +01:00
Claude
5f9e74b573
ax(ueps): replace error-path comment on ReadAndVerify with happy-path usage example
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:17:26 +01:00
Claude
501d7ecf11
ax(ueps): rename length/lengthByte to tagLength/tagLengthByte
AX Principle 1 — Predictable Names Over Short Names: `length` and
`lengthByte` are too generic for the TLV parsing context. Renamed to
`tagLength` and `tagLengthByte` so the variable names are
self-describing at read time.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:13:08 +01:00
Claude
8066610192
ax(ueps): remove prose comment that restated intent without a usage example
AX Principle 2: "If a comment restates what the type signature already says,
delete it." The "Store for processing" comment above the switch statement added
no information — the switch itself communicates that action.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:11:32 +01:00
Claude
9dea4d6ac4
ax(ueps): replace errors.Is usage examples with direct sentinel comparison
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
AX Principle 2 requires comments to show correct usage patterns.
errMissingHMAC and errIntegrityViolation are tlvError sentinels (comparable
values), so the examples should use == not errors.Is from the banned errors
package.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:05:29 +01:00
Claude
7aada5fc78
ax(ueps): remove duplicate inline usage comment from ReadAndVerify body
AX-2 violation: usage examples belong at the declaration site, not
scattered inside function bodies. The errIntegrityViolation usage hint
was already present at the variable declaration (line 17) and was
duplicated inside ReadAndVerify, creating noise in the implementation.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:01:28 +01:00
Claude
9779caa10e
ax(ueps): remove prose comments inside ReadAndVerify that restate implementation
AX Principle 2: comments show usage, not prose descriptions of what the code
does. The two inline comments in ReadAndVerify described buffer reconstruction
in words rather than showing a call — deleted per RFC-025 §2.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:57:10 +01:00
Claude
de6e4d019f
ax(ueps): rename value to tagValue in ReadAndVerify loop
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. The generic
local variable `value` required surrounding context to understand;
`tagValue` is self-documenting at every read site in the switch.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:50:53 +01:00
Claude
0c4cf1f7c3
ax(ueps): strip 11 prose test comments that restate function names
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Test names encode intent — prose descriptions add zero information.
Per AX-2: if comment restates the signature, delete it.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:48:01 +01:00
Claude
58e1c23f0c
ax(ueps): replace prose threat comment with error-handling 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 08:33:58 +01:00
Claude
6704ac781c
ax(mining): replace prose comments with usage examples in settings_manager.go
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Seven setter/getter comments restated the function signature rather than
showing a concrete call (AX Principle 2). Replaced all with real invocation
examples so agents know exactly how to call each method.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:26:55 +01:00
Claude
9ad8808d08
ax(ueps): replace prose sentinel error comments with usage examples
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
errMissingHMAC and errIntegrityViolation comments were prose
descriptions. Replaced with errors.Is() usage patterns.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:18:04 +01:00
Claude
d6f69faf6b
ax(ueps): replace errors import in reader.go with tlvError sentinels
Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:13:57 +01:00
Claude
82e52fb058
ax(ueps): rename parameter r to reader in ReadAndVerify
Some checks failed
Security Scan / security (push) Successful in 36s
Test / test (push) Has been cancelled
Single-letter parameter not in AX exception list.
r→reader across function signature and 4 call sites.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:04:28 +01:00
Claude
577775cbf8
ax(ueps): rename h→header and p→packet in usage example comments
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Single-letter variables in comments teach bad habits to agents.
Usage examples must use predictable names matching AX principle 1.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:00:43 +01:00
Claude
8a4010f4a5
ax(ueps): remove banned fmt import, use errors.New
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
fmt.Errorf with static string replaced by errors.New.
Removes banned import per AX RFC-025.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 07:48:46 +01:00
Claude
59d8ad388e
ax(ueps): rename mac to messageAuthCode (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 07:46:09 +01:00
Claude
9949942ff5
ax(ueps): replace ParsedPacket field-list 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:31:38 +01:00
Claude
49ac6d455a
ax(ueps): replace prose comments with usage examples (AX principle 2)
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
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>
2026-04-02 07:27:25 +01:00
Claude
b41c63b10f
ax(ueps): rename TagCurrentLay/TagTargetLay to TagCurrentLayer/TagTargetLayer
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
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>
2026-04-02 07:26:00 +01:00
775c35c772
Implement ReadAndVerify function for UEPS frames 2026-01-03 16:01:58 +00:00