Skip to content

feat(plan): say how to fix missing upstreams, and rebuild cloned tables with --changed - #1562

Merged
chio-labs-delivery[bot] merged 3 commits into
mainfrom
fix/missing-upstream-and-clone-consumption
Nov 17, 2026
Merged

chio-labs-delivery[bot] merged 3 commits into
mainfrom
fix/missing-upstream-and-clone-consumption

Conversation

@kvlonge

@kvlonge kvlonge commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Why

Two problems around building against data cloned from another target.

  • sqb clone, and the --defer-clone-from prephase of sqb build, replace a destination table but keep its consumption rows. Those rows describe the build the clone overwrote, so --changed could skip the cloned table as up to date with inputs it never read.
  • S301 (missing upstreams) named at most five upstreams and gave no fix, so users had to work out a clone or defer command by hand.

Changes

  • A clone appends a replaced consumption row for each table and seed it replaces. --changed reads it as "no completed record" and rebuilds the table once; the next build supersedes it. Rows are appended only, never updated. Partly failed defer clones still mark what they replaced. A failed marker write fails the command, after fingerprints are copied and after a defer clone's C411.
  • S301 lists the first five missing names and how many more. For every clone origin configured for the target it offers --defer-to (project targets only, and not when the plan already defers) and a copyable sqb clone --from … -s … naming every missing resource, plus "build them with +". sqb plan --json adds error.missing. The UI plan page shows the message with a copy button per clone command.
  • plan.mdx and its generated skill copy describe the new message. DuckShop gains a changed_builds_clone edge case.

Verification

  • New e2e cases in test_clone.py cover clone and defer-clone followed by --changed, a partly failed defer clone, and an unwritable consumption table. The clone cases and the C411 ordering case failed before their fix. Rust planner_identity cases and UI plan-text tests cover the message.
  • Targeted clone, plan, buildability and terminal-failure tests pass.
  • make check-ci passes on this head.

sqb clone (and a build's --defer-clone-from) replaced a destination
table but kept its consumption rows, which describe the build the clone
overwrote, so --changed could treat the cloned table as up to date with
inputs it never read. A clone now appends a 'replaced' row for each
table and seed it replaces; --changed reads that as no completed record
and rebuilds the table once, and a later build supersedes the marker.
S301 named at most five missing upstreams and stopped. It now lists the
first five, says how many more there are, and offers each fix: defer to
or clone from every target configured as a clone origin for this one
(with a copyable `sqb clone` command naming every missing resource), or
build them with `+`. Origins come from configuration only. `sqb plan
--json` lists every missing name in `error.missing`, and the plan page
shows the message as printed with a copy button per clone command.
…as replaced

A default target that does not resolve no longer turns S301 into an
unknown-target error; the clone command then names its destination.
--defer-to is offered only for project targets and not when the plan
already defers. A defer clone that fails for one boundary still marks
the boundaries it replaced. A failed marker write still fails the
command, but only after fingerprints are copied, and a defer clone's
C411 is reported first.
@chio-labs-delivery
chio-labs-delivery Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 4c4ffb0 Nov 17, 2026
34 checks passed
@chio-labs-delivery
chio-labs-delivery Bot deleted the fix/missing-upstream-and-clone-consumption branch November 17, 2026 23:35
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