Phase 1: JSON contracts foundation #5
Merged
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.
Summary
This PR establishes the JSON envelope structure and patterns for agent-friendly diagnostic outputs. It's the foundation for Phase 1 of the pgcrate roadmap.
Breaking Change: JSON output structure changed from flattened to nested
datafield. Consumers must update to read fromdataand handle new envelope fields.Key Changes
tool_version,generated_at,severity,partialfieldswarnings[]anderrors[]arrays with structured ReasonInfodatafield (no longer flattened)pgcrate context- Connection context, server info, extensions, privilegespgcrate capabilities- Permission-aware feature discovery$refcomposition withenvelope.schema.jsonReview Feedback Addressed
data_directorygated behind--no-redactflag--include-fixesflag (was no-op)indexescommand to returnSeverity::Warningwhen findings exist#[allow(dead_code)]annotationsTest plan
cargo test)cargo fmtpassescargo clippycleanpgcrate context --jsonpgcrate capabilities --jsonpgcrate triage --json(verify new envelope structure)