Skip to content

fix(read): merge-plans shows the survivor of a merge and both sides of a split (#838) - #1340

Merged
athvin merged 1 commit into
mainfrom
fix/838-merge-plans-survivor
Nov 28, 2026
Merged

athvin merged 1 commit into
mainfrom
fix/838-merge-plans-survivor

Conversation

@athvin

@athvin athvin commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #838

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

er_golden::merge_plans_sql's affected CTE follows details.merged_into (merge survivors) and includes split receivers and their details.split_from donors. The restored plan_master assertion in pg_merge_group, and a new executing test merge_plans_events.

#838: GET …/merge-plans (public, viewer) was empty for the entity a customer had just merged through POST …/merges or a review resolution. Fixed at the read layer as the ticket directed, leaving the public event ledger unchanged.

Proof

  • pg_merge_group (DuckLake): the survivor's plan elects the pinned master crm:C001; with the old CTE the survivor has no plan row (the survivor has a plan panics) — mutation-checked.
  • merge_plans_events (DuckDB, real lake DDL): an assertion-merge survivor, a split's receiver and its donor are planned; an untouched entity is not; with the old CTE the result is empty — mutation-checked.
  • pg_protect_master still passes; er-sql-check 68 passed (plan vectors for every policy × protect × since); make check exit 0.

Risk & rollback

A read widens to entities that genuinely changed; no write path or event changes. git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:24d16c2e-fec6-49d8-9797-060338df4848 on brians-MacBook-Pro · 2026-11-28T14:35:55Z

  • main is green with this change on it — the merge SHA, and the run
    that proves it. A later head SHA with this commit as an ancestor counts;
    a cancelled run with zero jobs does not: — 1153647, rust 46112834941 + frontend 46112834934 success
  • images built, or correctly never ran because nothing that goes into
    an image changed: — success, run 46112834937
  • deploy converged — proved by a line the running process emitted, not
    by the image digest and not by the workflow conclusion: — run 46113077015 success; the api pods rolled onto the new image after it (web-api-blue created post-deploy). A read-path change with no new route, so the evidence it is RIGHT is pg_merge_group and merge_plans_events, both mutation-checked
  • the push-only surface no pull request can pre-test (deploy, drift,
    kind's nightly leg) is green, or knowingly red for a reason that is not
    this change: — infra, devcontainer success on 1153647
  • the board card reached Done through the automation rather than by
    hand, and the issue closed: — merge-plans never shows the surviving entity of an assertion/steward merge #838 CLOSED by fix(read): merge-plans shows the survivor of a merge and both sides of a split (#838) #1340 via automation
  • follow-ups are open for everything deferred here — numbers: — none
  • what was learned is written down where the next session will find it
    (a skill, a reference, memory) — or nothing new was learned: — an executing DuckDB test over the real lake DDL is a cheap way to prove a governed generator's semantics, which plan vectors (planning only) cannot

Specific to this change

Context — plan, discoveries, measurements, files

Plan

Discoveries

  • A split changes two entities: the receiver (named by the event) and the donor (only in split_from); both are now affected.
  • The default most_attributes policy elects from golden_lineage, so the executing test uses most_complete; affected is shared by every policy.

Measurements

Files

🤖 Generated with Claude Code

…f a split (#838)

GET …/merge-plans was empty right after a steward or assertion merge —
the exact entity whose master was just pinned. Its `affected` set keyed
on the entity an event names, but a `merged` event is recorded on the
ABSORBED entity (which then has no members), and the survivor of a merge
whose records were all clustered already earns no `member_added`. Splits
were not considered at all.

`affected` now also takes the survivor named in a merged event's
details.merged_into, every `split` receiver, and the donor its
details.split_from names. Fixed at the read layer, so the public
entity-events ledger and webhooks are unchanged.

- pg_merge_group's plan_master assertion on the survivor is restored
  (and fails without the fix);
- merge_plans_events executes the generator on lake rows in DuckDB: the
  merge survivor, the split donor and receiver are planned, an untouched
  entity is not (all three missing without the fix);
- er-sql-check's plan vectors still plan for every policy × topology.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@athvin
athvin merged commit 1153647 into main Nov 28, 2026
44 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 28, 2026 05:36 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — 18f064a2 Deployed Nov 28, 2026 by athvin via remove closed PR previews #117
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.

merge-plans never shows the surviving entity of an assertion/steward merge

2 participants