Repository navigation
feat(writeback): merge previews for account datasets (#1309) - #1329
Merged
Merged
Conversation
The merge-preview job settled as a no-op on an account dataset: the task returned early, and the materializer elected over int_std_records and read person golden records. Now: - er-golden: acct_scoped_masters_sql, the scoped election over acct_int_std_records and acct_golden_lineage (most_complete counts the account survivable columns), sharing one builder with the person election, whose SQL is byte-identical. Plan vectors for every policy x protect. - entities: acct_golden_record/read/by_ids. - preview_job: the election, the golden values and the mappable columns follow the config's entity type, for previews and upserts alike. - The writeback and upsert policy APIs validate field_mapping keys against the golden columns of the policy's object (Account -> account columns). - materialize_previews no longer refuses account datasets (VERSION 2). - pg_merge_preview_acct_dag: an account dataset with a provenanced Account extract produces exactly the in-source pair's preview, from account goldens. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
temporarily deployed
to
marketing-preview
November 27, 2026 20:08 — with
GitHub Actions
Inactive
8 tasks done
This branch was previously deployed
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 #1309
What
An account dataset with an Account writeback policy now produces merge previews.
acct_scoped_masters_sqlruns the scoped election overacct_int_std_recordsandacct_golden_lineage, andmost_completecountsACCT_SURVIVABLE_COLUMNS. It shares one builder with the person election, whose SQL is byte-identical before and after (diffed over every policy × protect).acct_golden_record/read/by_ids.field_mappingkeys against the golden columns of the policy's object, so an Account policy mapscompany_name,domainand so on.materialize_previews: it no longer returnsNoOpfor a non-person config, andVERSIONgoes to 2.Why
The follow-up from #993. Before this, an account dataset's job settled as a no-op: the task refused non-person configs, and the materializer elected over person relations only.
Proof
pg_merge_preview_acct_dag: an operator-createdentity_type: accountdataset with its config published. A crm Account extract carrying an in-source duplicate (c1/c9) is provenanced, and a vendors upload is not. Generating yields exactly one Account preview: members c1 and c9,golden_fieldswithcompany_nameanddomain, a master that is a group member, and score 0.9985. The vendors rows are excluded asno_provenance. With the task's old guard in place, the same test sawitems: []. An Account policy mappinggiven_nameis refused with 422.er-sql-check:the_account_scoped_master_generator_plans_for_every_policy_and_topology(5 policies × protect), next to the unchanged person vectors.make check: exit 0.DEDUPE_E2E_DUCKLAKE=1 DEDUPE_E2E_EXTENSIONS=1 ER_TEST_PG_DSN=… cargo test -p er-server -p er-golden -p er-sql-check: 163 + 293 + 68 + 16 passed, 0 failed. That includes the personpg_merge_preview_dagandpg_merge_preview_api.Risk & rollback
Person datasets run the same SQL as before. A previously accepted policy whose
field_mappingnamed a person column on an Account object is now refused on its next PUT; such a policy could never have produced a preview. Rollback isgit revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:871c2645-29b1-4996-bd69-8809abfc82feonbrians-MacBook-Pro· 2026-11-27T20:29:02Zmainis 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: 0899cf9: rust 46061573253, frontend 46061573274, images 46061573221, infra 46061573252, devcontainer 46061573204, all success.
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: built, run 46061573221 success.
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: converged: deploy 46062031509 at 0899cf9, success, with the smoke test against the new colour logging readyz/healthz 200.
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: deploy green. drift is red on The er-alerts SNS email subscription has never been confirmed — 19 armed alarms reach nobody #1107's unconfirmed SNS subscriber and the nightly scale golden on scale golden (50k) fails deterministically on main since 03792063..ad38be23 (likely the DuckDB 2.0.1 bump) #1206, neither this change.
Donethrough the automation rather than byhand, and the issue closed: Merge previews for account datasets #1309 closed by the merge.
(a skill, a reference, memory) — or nothing new was learned: an entity statement added under entities/ also moves er-span's er.statement cardinality bound and the generated skill references (make skills-check after committing the new files, since the drift check reads tracked files).
Specific to this change
🤖 Generated with Claude Code