Skip to content

feat(plan): include each changed model's diffs in plan JSON - #1407

Merged
kvlonge merged 3 commits into
mainfrom
feat/plan-json-model-diffs
Nov 11, 2026
Merged

kvlonge merged 3 commits into
mainfrom
feat/plan-json-model-diffs

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Why

sqb plan prints each changed model's query diff, config diff and schema findings, but sqb plan --json left them out, so the UI and other tools could not show the same detail.

Changes

  • Plan JSON gains optional query_diff, config_diff and schema_findings per changed model. The text plan reads the same diffs and only colours them, and its output is unchanged.
  • A plan read through the server drops models[].query_diff and config_diff for a reader without view_sql on every current node, as it already did for Python identity_diff.
  • A location reads sqb plan output up to eight times the plan size cap. A plan over the cap keeps its plan and drops the model diffs, instead of failing as too large to show. A failed plan is never read as a plan.
  • No control API endpoints change; the plan document gains optional keys.

BEGIN_COMMIT_OVERRIDE
feat(plan): sqb plan --json now includes each changed model's query diff, config diff and schema findings, as the text plan prints them
END_COMMIT_OVERRIDE

Verification

  • Person plan reads pass on SQLite and PostgreSQL, and assert that a viewer without view_sql gets no model diffs.
  • New location plan tests cover diffs kept under the cap, dropped over it, and a failed plan.
  • Plan output unit tests: 75 passed. clippy (-D warnings), rustfmt and fensu are clean.
  • The touched files are identical between the original base and current main. full-verify builds and tests this on main.

sqb plan --json now carries the query diff, config diff and schema findings
that the text plan prints under a changed model, so other tools can show the
same detail. The text plan reads the same diffs and only colours them.

A plan read from the server drops the query and config diffs for someone who
may not read SQL on every node, as it already did for Python diffs. A location
drops model diffs from a plan that would otherwise exceed the server's size
limit, so a large change still plans.
@kvlonge kvlonge added the full-verify Run the full Verify matrix on this pull request label Nov 10, 2026
@kvlonge
kvlonge enabled auto-merge (squash) November 10, 2026 23:44
…an docs skill

Move the plan failure report into the shared execution helpers so the plan
document module exposes only plan_document, and regenerate the bundled docs
skill page for the new plan JSON keys.
@kvlonge
kvlonge merged commit 3f335b7 into main Nov 11, 2026
51 checks passed
@kvlonge
kvlonge deleted the feat/plan-json-model-diffs branch November 11, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-verify Run the full Verify matrix on this pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant