Skip to content

fix(server): preview plan --changed from the synced consumption copy - #1467

Merged
chio-labs-delivery[bot] merged 5 commits into
mainfrom
fix/changed-preview-synced-copy
Nov 14, 2026
Merged

chio-labs-delivery[bot] merged 5 commits into
mainfrom
fix/changed-preview-synced-copy

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Why

A location's --changed plan preview listed every model as changed ("no completed record"). It read consumption history through the warehouse adapter, which a preview refuses, and the copy it plans from never carried consumption rows.

Changes

  • A --changed plan sets a new consumption flag on the preview-copy request, and the server then sends every mirrored consumption row for the target. Complete scans keep the mirror to what the warehouse retains.
  • Without the flag, neither the request nor the copy carries the field, so either side can be a version older than the other for plans without --changed.
  • The preview's recent read picks each relation's newest 8 executions by start time with recent_executions, the in-memory form of the warehouse query, which the consumption simulation now shares. Read-back of older executions searches all copied rows.
  • The control client gains the fields, and the synced-copy boundary rule lists the consumption reader as a preview branch.

Verification

  • New E2E in test_plan_preview.py: edit one model, then request a --changed plan from a location while the warehouse is locked. The preview's changed block equals live sqb plan --changed --json. It fails on main.
  • Preview-copy test on SQLite and PostgreSQL: a request without the flag gets no consumption key; with it, all executions of a busy relation come back.
  • recent_executions cases: a late finisher and an exact start-time tie.
  • The consumption simulation passes, and so does make check-ci.

DuckShop: not applicable. This is the location's preview path between the server mirror and the planner, with no new project shape, data value or build lifecycle.

A location's plan preview read consumption history through the warehouse
adapter, which the preview refuses, so every model and seed counted as
changed. The preview copy now carries each relation's newest executions,
ranked as a build reads them, and the preview reads them from the copy.
…s in memory

The preview copy carried only each relation's newest 8 executions, so
read-back of an older execution found nothing and its readers counted as
changed. The server now sends every mirrored row, but only when a
--changed plan asks for them, so older locations never receive a field
they reject. The recent read ranks executions with recent_executions,
which the consumption simulation now shares.
A preview-copy request from an upgraded location now omits the flag
unless a --changed plan sets it, so other plans still reach a server
that predates the flag.
Move the location plan-from-copy helper out of the test module, drive
the --changed preview and recent executions tests from test cases, keep
the synced copy's consumption read in its own layer, and list the
consumption state reader as a synced-copy preview branch.
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit d9c6858 Nov 14, 2026
27 of 28 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the fix/changed-preview-synced-copy branch November 14, 2026 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant