Repository navigation
feat(ui): editable review group dialog — N records, master, click-to-copy (#802) - #829
Merged
Merged
Conversation
…cord-keyed field pins (#802) Spec 2.8: the review decision panel gains an editable group merge. A new record-keyed lake overlay (golden_record_override, latest-wins) carries the dialog's per-field pins; POST /merges stages the assertion star + the master's protect + the pins as one bundle; the dialog itself is a radix Dialog grid with click-to-copy, inline edit and master reassignment over a pure draft reducer. Tested: merge-draft units, MergeGroupGrid component, a three-test Playwright journey against a dedicated merge-dev fixture org, and a pg + DuckLake e2e that drives the production bundle path and asserts the merged entity's golden record carries exactly the pinned values.
athvin
force-pushed
the
issue/802-review-group-dialog
branch
from
November 8, 2026 05:52
75b6b70 to
14eaca6
Compare
athvin
marked this pull request as ready for review
November 8, 2026 05:52
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 #802
What
Makes the review merge editable: a group dialog (N records from both sides' entities, not just the pair) with a designated master, click-to-copy/revert per field, inline edit for text + date attributes, and master reassignment — persisted through a new
POST /mergesthat stages the assertion star, the master protect and record-keyed field overrides in one bundle. Record-keyed overrides are a new lake store (golden_record_override) resolved through fresh membership at golden-assembly time, so copied values land on the entity the merge mints.Why
Spec unit 2.8 (parent epic #516). The dialog displayed a pair comparison but could not edit one, and the pair shape hid the records a merge would actually combine.
Proof
make check+make check-e2e; new component + functional tests (3-record group merged from the dialog lands exactly as shown);make frontend. Base golden fixtures byte-identical (the new store is empty for every existing org).Risk & rollback
New lake table and a new staging bundle — both inert until the dialog is used; existing override and resolve paths untouched. Rollback:
git revert <merge-sha>; any staged record-keyed overrides are inert rows without the assemble reader.Post-merge ledger
Closed by: agent · codex session
01a1b861-d8a0-7400-8aae-17fdde0059econbrians-MacBook-Pro· 2026-11-08T06:23:45Zmainis green with this change on it — 0a4aac5 is main's tip;rust, frontend, infra, devcontainer, images, deploy ALL success on the
merge SHA itself (no cancelled zero-job stand-ins):
imagesbuilt — rust + frontend image inputs changed, run successon 0a4aac5, and deploy fired off it via workflow_run:
deployconverged — run 42453758748's smoke step loggeder-api-preview /readyz -> 200ander-web-preview /api/healthz -> 200("the blue colour serves through its own Services") before cutover, then
concluded success. A pod-level log line beyond the smoke probe was not
observable from this session — no cluster credentials (kubectl: "the
server has asked for the client to provide credentials"):
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy success on 0a4aac5; drift's scheduled leg success on
b4b0b0f (06:02Z today, predates this merge — next leg tonight); kind's
nightly leg success on b586498 (04:40Z today):
Donethrough the automation rather than byhand, and the issue closed: feat(ui): make the review comparison editable — group with a master, click-to-copy, inline edit #802 CLOSED, card Done — verified via
gh issue view+item-list, not moved by hand:follow-upsare open for everything deferred here — numbers:merge-plans never shows the surviving entity of an assertion/steward merge #838 (merge-plans blind to the assertion-merge survivor — P1),
mobile review flow has no group-merge path #842 (mobile group-merge surface):
(a skill, a reference, memory) — or nothing new was learned: five entries
added to Discoveries below — the merge-plans never shows the surviving entity of an assertion/steward merge #838 mechanism, the one-review-per-test
fixture rule, P1's ten-member shape, the HEAD-relative drift gate, and
the envelope/MCP regenerate command:
Specific to this change
Context — plan, discoveries, measurements, files
Plan
golden_record_override(entities/golden_record_override/): record-keyed steward field pins, latest-wins per(record_key, attribute), NULL = clear.create/set+delete/clearstatements; registered iner-schemamodel.rs + regenerated registry golden.entities/golden_record/update/override_record_<attr>.sql): resolverecord_key → entity_idthrough currententity_membershipat golden-assembly time (latestcreated_atwins when several member rows name one attribute). Applied inrun_goldenAFTER the entity-keyed pass, so dialog choices win; an empty table is a byte-exact no-op (base fixtures unchanged).override_field_by_recordiner-cli::apply_staged_action_labeled— mirrorsoverride_field, writes the record-keyed store.POST /v1/orgs/{org}/datasets/{ds}/merges(steward):{records[2..=50], master, overrides[0..=11], review_id?, apply_now}. Stages, in one bundle: analwaysassertion star to the master,protect_record(master), each override keyed by the master's record_key, andresolve_review(match)when a review is named;apply_nowenqueuesapply_correctionslike mass-update. Auditsteward.merge_group.GET …/reviews/{review_id}/merge-group(viewer): composes existing reads server-side — review's pair → each side's entity (viaentity_of_record_key) → union of member keys (entity_member_keys, rec_a's entity first) →records_by_keyvalues, each item stamped with itsentity_id;{items, total, snapshot}. 422 for entity-subject reviews (no pair).POST /api/orgs/[org]/datasets/[ds]/merges(steward) andGET …/reviews/[reviewId]/merge-group(viewer), zod-validated,requireDatasetAccess.pnpm dlx shadcn@latest add dialog(the house rule for a missing primitive), thenmerge-group-dialog.tsx: N record columns, master leftmost and marked by inversion + the word "master" (no hue); radio in each header reassigns the master; clicking a member's differing non-empty value stages a copy (weight + underline + sr-only "staged"), clicking again reverts; master cells inline-edit (text input,type=dateforbirth_date— the only typed kinds the attribute model carries); footer merges with the staged count in the label.frontend/src/lib/domain/merge-draft.ts: pure stage/revert/reassign/clear logic — the unit-tested core, which also feeds thesrc/libcoverage floor.Gates that prove it
make check(entities verify + lint + tests),make frontend(lint/types/unit + functional + axe),make check-e2efor the lake path.pg_merge_group.rs(own binary; gatedER_TEST_PG_DSN+DEDUPE_E2E_DUCKLAKE=1): merge a 3-record group from one POST with a copied email → afterapply_corrections, one entity holds all three records and its golden email is the copied value — "lands exactly as shown" at the lake level.mutable-dev(acme-dev is render-only), copy + inline-edit + reassign, assert the POSTed bundle matches what the dialog showed.cli_e2e.rsfileless-table list gainsgolden_record_overrides.Discoveries
protect_recordalready forces master on the merge-plans read path; golden survivorship is per-field, so "master" alone never copies values — the overrides do that.SourceRecord.entity_idwas already declared in the frontend types but the server never sent it; the dedicated merge-group read sidesteps changingrecords_by_key.Dialogprimitive was installed; added through the shadcn CLI per the design-system skill.merge_plans_sql'saffectedCTE keys on the entity_id an event names;reconcile_planrecordsmergedonly on the ABSORBED ids andmember_addedonly for previously unclustered records, so the entity the steward just merged INTO earns no event and no plan row. Filed as merge-plans never shows the surviving entity of an assertion/steward merge #838; the pg e2e asserts the protect overlay at the lake instead, withpg_protect_master's organic merge covering the election read.merge-devcarries three same-shape copies for exactly this reason.crm:C009), so a three-persona merge mints a TEN-member entity, not nine.make checkreports green locally — regen, commit, then gate.cargo test -p er-server --test main response_envelopes -- --ignored regenerate(which also refreshes the MCPtools.json) or the BFF envelope contract test fails on the frontend side.Measurements
make checkgreen on the rebased head (14eaca6), incl.er-entity verify(50 entities / 255 statements current) and the full workspace test run.make frontendgreen: 892 vitest unit/component (incl. 10 merge-draft + 7 grid), 546 Playwright functional passed across three device projects, axe serious/critical clean on the open dialog.pg_merge_groupe2e: 33s against local Postgres + DuckLake; asserts the staged bundle becomes the merged entity's golden record exactly as shown.detectjobs.Files
entities/golden_record_override/**(new),entities/golden_record/update/override_record_*(new),rust/crates/er-schema/src/model.rs+ registry goldenrust/crates/er-cli/src/lib.rs(apply arm + assemble hook),rust/crates/er-server/src/lib.rs(two endpoints),rust/crates/er-server/src/read.rs(merge-group read)frontend/src/components/review/merge-group-dialog.tsx,decision-panel.tsx,lib/query/merge-group.ts,lib/domain/merge-draft.ts, BFF routes, ui/dialog primitivefrontend/tests/mock-erserver/server.mjs(merge-group + merges routes, a 3-record review fixture in a mutable org),tests/functional/reviews.spec.tsrust/crates/er-server/tests/pg_merge_group.rs(new binary),rust/crates/er-cli/tests/cli_e2e.rs(fileless list)