Commit graph

13 commits

Author SHA1 Message Date
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
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
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
b8d7216905
ax(ueps): fix AX-2 violation in TestReader_ReadAndVerify_Bad — add errIntegrityViolation sentinel check
Comment described assertion in prose ("integrity violation" in error message) rather
than showing the concrete sentinel pattern. Test also failed to verify err identity
consistently with TestReader_ReadAndVerify_Ugly and packet_test.go error tests.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 13:04:43 +01:00
Claude
c20670f062
ax(ueps): remove double-slash comment prefix violating AX Principle 2
Some checks failed
Test / test (push) Successful in 4m40s
Security Scan / security (push) Failing after 12m22s
Test doc-comments used `// //` to prefix expected-result lines, producing
comments-within-comments rather than clean usage examples. Strip the
redundant inner `//` so all lines read as plain code-example comments.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 12:25:45 +01:00
Claude
5188cb617c
ax(ueps): remove redundant inline comment that restates the pre-function docstring
Some checks failed
Test / test (push) Has been cancelled
Security Scan / security (push) Has been cancelled
AX Principle 2: comments that restate what the surrounding code already
says are noise. The inline comment inside TestReader_ReadAndVerify_Ugly
duplicated the usage example already present in the function docstring.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 11:01:18 +01:00
Claude
dd981edea9
ax(ueps): remove prose inline comments that restate code intent
AX Principle 2: comments must be usage examples, not prose descriptions.
"Corrupt the last byte of the payload/frame" restates what the adjacent
code does rather than demonstrating a call with concrete values.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:55:00 +01:00
Claude
7b50431043
ax(ueps): replace prose comment with usage example in ReadAndVerify Ugly test
Some checks failed
Security Scan / security (push) Successful in 32s
Test / test (push) Has been cancelled
AX Principle 2: comments must be usage examples, not prose descriptions.
The inline comment restated intent in English rather than showing a concrete call.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 10:43:42 +01:00
Claude
840418c33e
ax(ueps): rename NewBuilder to NewPacketBuilder for AX Principle 1 compliance
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Ambiguous constructor name required reading the return type to know what
it builds. NewPacketBuilder is self-documenting without context.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:45:23 +01:00
Claude
21b7eb9a93
ax(ueps): test errMissingHMAC path in ReadAndVerify Ugly case
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
TestReader_ReadAndVerify_Ugly previously tested wrong-secret (errIntegrityViolation),
duplicating the Bad case. Replaced with a hand-crafted frame that omits the HMAC TLV,
exercising the errMissingHMAC sentinel that was entirely untested.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 09:41:48 +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
9dbde075b2
ax(ueps): remove prose description from TestReader_ReadAndVerify_Good comment
AX Principle 2 — comments must be usage examples, not prose descriptions.
The leading "verifies a well-formed signed frame" line restated the test
name without adding information; the usage example below it was sufficient.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:30:33 +01:00
Claude
72d85986c6
ax(ueps): add reader_test.go with Good/Bad/Ugly coverage for ReadAndVerify
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
One test file per source file is mandatory per AX conventions. reader.go
had no corresponding test file — this adds the three required test cases
covering valid round-trip, tampered frame rejection, and wrong-secret rejection.

Co-Authored-By: Charon <charon@lethean.io>
2026-04-02 08:11:05 +01:00