v1.0.3
Patch release closing the three actionable findings from
docs/assessment-maintainable-architect-v4-v1.0.2.md, which reconciled
two disagreeing Codex reviews of v1.0.2 (one reporting zero findings,
one reporting five) through independent adversarial verification. No
breaking changes; module path unchanged.
Fixed:
- A typed-nil coded error (e.g. a
*NotFoundErrorreturned nil on some
path, then assigned to a plainerror) panicked response rendering
instead of classifying asErrCodeInternal.errors.Asmatches on
type, not nilness, so the classic Go typed-nil-interface footgun
reachedCode()on a nil receiver before any accessor ran.
outermostCodednow rejects a typed-nil match centrally, so
GetErrorCodeand every JSON/problem body writer that shares it
degrade toErrCodeInternalinstead of dereferencing. - An external
Coder-only implementation (a documented, first-class
extension point that doesn't require embeddingBaseError) could
return""fromCode()and have it ride straight through to the
wire as the machine-readable error code.New/Wrapalready
normalized this for the package's own constructors as of v1.0.2;
GetErrorCodenow normalizes it too, closing the gap for bare
third-party types at the one extraction point every renderer funnels
through.
Documented:
Coder,ProblemTyper,ProblemInstancer,ProblemTitler, and
Authenticatornow state their contract explicitly: atruebool
return implies a non-empty string, the same guaranteeBaseError's
own implementations already make. No code change - a third-party
implementation following the documented convention was already safe.- Two design choices raised by the v1.0.2 review and confirmed
deliberate rather than oversights are now recorded as ADRs instead of
living only in review prose:Loggerhas nocontext.Context
parameter (docs/adr/0001),
and a marshal-panic log keeps the original error's stack rather than
capturing a second one at the panic site
(docs/adr/0002).
Test coverage: 100.0% (root module), 100.0% (zerologadapter, unchanged
this release).