v1.0.4
Patch release closing the M1 finding from
docs/assessment-maintainable-architect-v4-v1.0.3.md,
which reconciled two independent reviews of v1.0.3 (a Codex direct review
and a second, adversarially-minded review) through fresh verification
against actual source rather than trusting either review's prose. No
breaking changes; module path unchanged.
Fixed:
- v1.0.3 protected classification (
GetErrorCode) against a typed-nil
coded error (e.g. a*NotFoundErrorreturned nil on some path, then
assigned to a plainerror), butGetStackTraceand
RecaptureStackTraceshared no such guard - each ran its own
errors.Assearch and called the result directly, panicking on the
same typed-nil-interface footgunoutermostCodedalready closed for
classification. SinceerrorLogFieldscallsGetStackTracefor any
5xx classification (exactly what a typed-nil error normalizes to),
this reachedWriteHTTPError/WriteHTTPProblemduring logging,
after the response body had already been written. Verified
end-to-end against a realhttptest.Server: inside
RecoveryMiddleware, that second panic was treated as arriving after
response commitment, aborting the connection and dropping an
already-correct 500 response instead of delivering it. Both functions
now shareoutermostCoded'sisNilValueguard, treating a typed-nil
match as "not found" rather than dereferencing it. logErrornow returns immediately when the logger isnil, before
building log fields, matching the early-return patternRenderer.log
already used one layer up - avoids doing (and risking) work for a
caller who opted out of logging entirely.
Test coverage: 100.0% (root module). zerologadapter is unchanged this
release - per the documented adapter-versioning policy, it's tagged
independently and only when the adapter itself changes, so its latest
tag lagging the root's is expected, not an oversight.