Replace single-letter receivers (m *Message, e *ProtocolError) and
parameter (v interface{}) with full names (message, protocolError, target)
per AX Principle 1: predictable names over short names.
Co-Authored-By: Charon <charon@lethean.io>
Single-letter receiver `h` requires mental mapping to understand it refers to
*ResponseHandler. Renamed to `handler` for self-documenting, predictable naming.
Co-Authored-By: Charon <charon@lethean.io>
Replace fmt.Sprintf/fmt.Errorf with strconv.Itoa and string
concatenation; surface fmt.Errorf error paths as typed
*ProtocolError values for consistent protocol error handling.
Co-Authored-By: Charon <charon@lethean.io>
Comments on saveNow, save, load, Close, and DefaultResponseHandler
restated what the signature already said. Replace with concrete call
examples showing how each is actually invoked.
Co-Authored-By: Charon <charon@lethean.io>
ValidateResponse, ParseResponse, and GetProtocolErrorCode had comments
that restated the function signature in prose — violating AX Principle 2
which requires comments to show concrete call-site usage, not descriptions.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2 — comments show HOW with real values, not what the
signature already says. The previous comment restated the method name
as prose; replaced with a concrete call pattern.
Co-Authored-By: Charon <charon@lethean.io>
AX Principle 2 — comments show HOW with real values, not what the
signature already says. "returns true if the error is a ProtocolError"
restates the type; a concrete call pattern teaches agents how to use it.
Co-Authored-By: Charon <charon@lethean.io>
ProtocolError and ResponseHandler had prose descriptions restating
their names — AX Principle 2 violation. Replaced with concrete call
examples showing how callers use each type.
Co-Authored-By: Charon <charon@lethean.io>