Preserve structured diagnostics and candidate error context
This commit is contained in:
@@ -21,6 +21,12 @@ for those child commands. Missing local objects produce inspection errors;
|
||||
source preparation retains its separate network-capable operations. See Git's
|
||||
[lazy-fetch controls](https://git-scm.com/docs/git) for the command mechanism.
|
||||
|
||||
Public validation errors convert their diagnostic fields to the internal
|
||||
failure model for shared formatting. Converted failures retain their original
|
||||
contextual cause and reuse its rendering when it already contains the same
|
||||
diagnostics. The CLI presents the complete error chain, including candidate
|
||||
context around callback-supplied diagnostics.
|
||||
|
||||
## Adding a shared check
|
||||
|
||||
When an optional check is accepted for implementation:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Shared validation foundation remediation
|
||||
|
||||
Status: Remediation in progress; findings 1–3 addressed, findings 4–6 pending.
|
||||
Status: Remediation in progress; findings 1–4 addressed, findings 5–6 pending.
|
||||
|
||||
Reviewed committed implementation `f53354b`, covering the eight foundation
|
||||
commits after `0c7129a`, against the [implementation plan](implementation.md),
|
||||
@@ -130,6 +130,15 @@ reads from fully populated candidates.
|
||||
|
||||
## 4. P2: Public and CLI error presentation loses diagnostic information
|
||||
|
||||
**Resolution:** Addressed. Public errors use the internal diagnostic formatter
|
||||
with explicit conversions, including findings, targets, directives,
|
||||
measurements, and causes. Matching converted diagnostics reuse their contextual
|
||||
cause's rendering once. The CLI preserves outer wrappers, and callback errors
|
||||
retain their public identity. Regression tests cover both candidate operations
|
||||
and caller-created errors with and without causes.
|
||||
`go test . ./cmd/releasekit ./internal/validation ./internal/apicheck` and
|
||||
`go run ./internal/apicheck` passed.
|
||||
|
||||
**Owners:** [public diagnostics](../../validation_error.go),
|
||||
`ValidationError.Error` and its formatter; [CLI presentation](../../cmd/releasekit/main.go),
|
||||
`candidateFailureText`; [internal formatting](../../internal/validation/diagnostic.go).
|
||||
|
||||
Reference in New Issue
Block a user