Add pkg/plan: one versioned dry-run report for both front doors - #8
Draft
Kiran01bm wants to merge 1 commit into
Draft
Add pkg/plan: one versioned dry-run report for both front doors#8Kiran01bm wants to merge 1 commit into
Kiran01bm wants to merge 1 commit into
Conversation
migrate --dry-run --json and diff --json previously emitted two ad-hoc JSON shapes (router.Plan and a private diffReport). Consolidate them into a single versioned plan.Report (format_version 1) so an orchestrator adapter parses one contract regardless of how the plan was derived. Groundwork for PLAT-38440 (dry-run plan + suggest surface).
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.
Summary
Consolidates the engine's two ad-hoc dry-run JSON shapes into one versioned, machine-readable plan contract:
pkg/plan.Report. Both front doors —migrate --dry-run --jsonanddiff --json— now emit the same shape, so an orchestrator adapter parses one contract regardless of how the plan was derived. First slice of the P2.5 dry-run/advisory surface; a real linter and an advisorysuggestcommand stack on top of this.What
pkg/plan:Reportwithformat_version: 1, a typedsource(alter|diff), and a sharedStatementcarrying SQL, route, backend, disposition, per-operation decisions, and the saferexec_sqlsequence.migrate --dry-run --jsonemitsplan.Reportinstead of rawrouter.Plan;diff --jsonemits it instead of the privatediffReport.table_existsis optional (pointer): set only by the diff path, which introspects for existence; omitted for the alter path.statementsas[], nevernull; consumers reject unknownformat_version.pkg/planat 100% statement coverage.Why
The dry-run report is the seam a future orchestration adapter consumes to decide whether and how a change would execute. Two divergent, unversioned shapes made that seam fragile: consumers had to know which command produced the JSON and could not detect contract drift. One versioned report removes both problems before the linter and
suggestsurfaces widen the contract.Before / after
References
kiran01bm/oss-standup)