From 0a30a45b7dff7c7dbe75f4cff41736eb3488338d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 12:13:50 +0100 Subject: [PATCH] ax(ueps): add usage-example comments to exported tag constants TagCurrentLayer, TagTargetLayer, TagIntent, and TagThreatScore were exported constants with no comment, violating AX Principle 2 (comments as usage examples). Each now has a concrete writeTLV call showing the tag, value encoding, and valid range where relevant. Co-Authored-By: Charon --- pkg/ueps/packet.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/ueps/packet.go b/pkg/ueps/packet.go index f310eae..6657ae3 100644 --- a/pkg/ueps/packet.go +++ b/pkg/ueps/packet.go @@ -18,11 +18,11 @@ func (packetErrorValue packetError) Error() string { return string(packetErrorVa // writeTLV(buffer, TagVersion, []byte{0x09}); writeTLV(buffer, TagHMAC, hmacSignature); buffer.WriteByte(TagPayload) const ( - TagVersion = 0x01 - TagCurrentLayer = 0x02 - TagTargetLayer = 0x03 - TagIntent = 0x04 - TagThreatScore = 0x05 + TagVersion = 0x01 // writeTLV(buffer, TagVersion, []byte{0x09}) + TagCurrentLayer = 0x02 // writeTLV(buffer, TagCurrentLayer, []byte{5}) // 5 = Application + TagTargetLayer = 0x03 // writeTLV(buffer, TagTargetLayer, []byte{3}) // 3 = Network + TagIntent = 0x04 // writeTLV(buffer, TagIntent, []byte{0x01}) // 0x01 = ping, 0x02 = data, 0x03 = auth + TagThreatScore = 0x05 // writeTLV(buffer, TagThreatScore, []byte{0x00, 0x00}) // 0 = clean, 65535 = max threat TagHMAC = 0x06 // writeTLV(buffer, TagHMAC, hmacSignature) — covers all preceding header TLVs + payload TagPayload = 0xFF // buffer.WriteByte(TagPayload); buffer.Write(rawPayload) — no length prefix )