Refactor app validation errors: result-based parsing, structured error data#7126
Open
ryancbahan wants to merge 3 commits intomainfrom
Open
Refactor app validation errors: result-based parsing, structured error data#7126ryancbahan wants to merge 3 commits intomainfrom
ryancbahan wants to merge 3 commits intomainfrom
Conversation
Contributor
|
We detected some changes at Caution DO NOT create changesets for features which you do not wish to be included in the public changelog of the next CLI release. |
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
…r data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…r data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
768157b to
3249375
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What
Refactor app validation error handling from throw/catch with styled
OutputMessageto result-based parsing with a plainConfigurationErrordata interface.Why
Prep for
app config validate --json(see #7066, #7090, #7106). The original stack added structured error data alongside rendered messages, creating dual-track serialization in the loader. This PR takes the opposite approach: make errors pure data, let callers render. This gives callers more flexibility and removes the job of rendering/formatting from the data flow.How
ConfigurationErroris now a plain interface ({file, message, path?, code?}), not a class extendingAbortErrorparseConfigurationObject,parseConfigurationObjectAgainstSpecification,parseConfigurationFilereturn{data} | {errors: ConfigurationError[]}instead of throwingAppErrorsstoresConfigurationError[]withaddError,addErrors,getErrors(file?),isEmptyformatConfigurationErroris the single plain-text formatting functionoutputContent/outputToken) applied only at display boundaries:app-context.ts(AbortError),validate.ts(renderError),loader.ts(reloadApp)parseStructuredErrorsinerror-parsing.tsconverts Zod issues toParsedIssue[]with union-variant scoringNo user-facing behavior changes. CLI output preserves styling. Multi-error-per-file now preserved (previously silently overwritten by dictionary key).