Repository navigation
feat(review): merge arbitrary records the matcher never grouped (#804) - #872
Merged
Merged
Conversation
4 tasks
Steward/admin multi-select on the records screen opens a manual merge dialog that unions the selected entities' members, lets the steward pick the surviving entity (its first member becomes master), and POSTs /merges with apply_now and no review_id. er-server derives the merge origin from review_id presence and records it in the assertion note and the steward.merge_group audit detail; no client-supplied flag. Closes #804
…ev pristine pg_serial allows one tokio::test per file: merge_group's two tests become sequential phases sharing the file's one database, the manual phase keyed on initech/globex since the first phase owns acme. The manual-merge Playwright journey moves to merge-dev — its POST bumps the org's stagedCount, and acme-dev's banner count is asserted verbatim by the reviews spec. merge-dev gains the two golden entities the journey selects. Drops a lint-flagged unneeded type assertion in the unit test.
athvin
force-pushed
the
issue/804-merge-arbitrary
branch
from
November 8, 2026 15:39
16f74a0 to
37422da
Compare
athvin
marked this pull request as ready for review
November 8, 2026 15:40
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.
Closes #804
What
The records browser gains a steward/admin multi-select with a "Merge selected"
action opening a
ManualMergeDialog: the selected entities with their membercounts, a radio picking the survivor (master = the survivor's first member),
then
POST /mergeswith the union of member keys,apply_now: trueand noreview_id. Server-side,merge_groupnow derives the merge's origin from thebundle itself —
review_idpresent →review, absent →manual— recorded inthe assertion note ("manual merge (no detected group)") and the
steward.merge_groupaudit detail's"origin".Why
Spec 2.10 / #804: records the matcher never grouped had no group-selection
merge path with a master choice (#802's dialog covers pairwise entity ad-hoc
merge), and nothing distinguished a manual merge from a detected one in the
ledger. Overrides stay post-merge deliberately — the
GroupMergeEditoron themerged entity already covers them.
Proof
make check— green, includingpg_merge_group::merge_group_bundle_and_manual_merge_equalityrun locally with
ER_TEST_PG_DSN+DEDUPE_E2E_DUCKLAKE=1(two identicallakes; manual merge of the never-grouped crm:C005 + billing:B006 pair equals
the detected-path golden, origin asserted in the assertion notes and audit).
make frontend— green: 558 passed / 0 failed; new unit tests formanualMergePayload, and a Playwright journey (viewer sees no selection,two-record merge asserts the POST body, axe scan on the open dialog).
Risk & rollback
Low: additive UI gated to steward/admin, and the server change is a derived
marker on an endpoint that already accepted arbitrary keys. Roll back with
git revert <merge-sha>.Post-merge ledger
Closed by: unclosed
mainis green with this change on it — the merge SHA, and the runthat proves it. A later head SHA with this commit as an ancestor counts;
a cancelled run with zero jobs does not:
imagesbuilt, or correctly never ran because nothing that goes intoan image changed:
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion:
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change:
Donethrough the automation rather than byhand, and the issue closed:
(a skill, a reference, memory) — or nothing new was learned:
Specific to this change
Context — plan, discoveries, measurements, files
Plan
merge_groupderives origin fromreview_idpresence; assertion notes distinguish "manual merge (nodetected group)" vs "review merge dialog"; audit detail gains
"origin". No client-supplied flag to spoof.pg_merge_group.rssecond phase: thenever-grouped pair merged with no
review_idequals the detected-pathgolden, with the origin marker asserted. Restructured into sequential
phases after
pg_serialrejected two#[tokio::test]s in one file.ManualMergeDialog(survivor radio, master = survivor's first member,union of member keys,
apply_now: true, noreview_id).journey asserting the POST body; axe scan on the open dialog.
make check,make frontend, pg+e2e run locally with both envs.Discoveries
MergeRecordsDialogalreadymerges two ENTITIES ad hoc. What was genuinely absent: GROUP selection with
a master choice, and any manual-origin marker in the audit trail.
POST /mergesalready accepted arbitrary record keys and an optionalreview_id; the server gap was only the origin marker.pg_serialkeys one Postgres databaseper test FILE (extra tests become sequential phases with their own org
names), and the mock erserver's
POST /mergesbumps the org'sstagedCount— so a mutating journey cannot run on acme-dev, whose "3 decisions queued"
banner reviews.spec.ts asserts verbatim. The journey runs on merge-dev, which
gained the two golden entities it selects.
dialog mid
animate-lift-inand reports colour-contrast violations againstmarkup compliant once the animation completes; the spec scans under
reducedMotion: "reduce".Files
rust/crates/er-server/src/lib.rs— origin derivation inmerge_group.rust/crates/er-server/tests/pg_merge_group.rs— the two-phase e2e.frontend/src/lib/domain/manual-merge.ts— pure payload assembly.frontend/src/components/records/manual-merge-dialog.tsx— the dialog.frontend/src/components/records/records-browser.tsx— selection UI.frontend/src/lib/query/merge-group.ts,keys.ts— optional overrides,apply_now, golden/entity invalidation on success.frontend/tests/unit/manual-merge.test.ts,frontend/tests/functional/records.spec.ts,frontend/tests/mock-erserver/server.mjs— tests and fixtures.