Repository navigation
feat(writeback): materialize Salesforce merge previews from resolution results (#993) - #1310
Merged
Merged
Conversation
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
…n results (#993) The second half of #993: a `merge_preview` job turns a dataset's results into reviewable writeback proposals, one per (entity, connection, object) group, stored through #1305's persistence and approved through its API. - POST …/merge-previews/generate (steward) queues the job; the key covers the checkpoint and the active policy revisions, so the same inputs give the same job. - materialize_previews (pod, read-only, one pinned snapshot): reads succeeded runs after a (snapshot_end, run id) checkpoint, the entities their events touched, members, their latest raw rows and golden values. A member is eligible only on evidence — not deleted, its row's run has #1296 provenance for its own source, the source is not delivered by two connections, and a policy covers the (connection, object). Uploads never join. Masters come from er_golden::scoped_masters_sql: the export's policy vocabulary restricted to the eligible members per group (plan-vector tested for every policy × protect). - publish_previews (control, one transaction): re-validates each proposal through MergeProposal::build against the pod's fingerprint, publishes idempotently, supersedes stale planned previews, then advances the checkpoint by compare-and-set. - The Postgres context the pod cannot reach (policies, provenance, ambiguous sources, checkpoint) rides in its work order. - writeback policy mapping keys must be golden record columns. v1 limits: person datasets (#1309); related-record counts unavailable. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
force-pushed
the
feat/993-materialize-previews
branch
from
November 27, 2026 05:22
51f52a7 to
6c5d6d8
Compare
athvin
temporarily deployed
to
marketing-preview
November 27, 2026 05:31 — with
GitHub Actions
Inactive
athvin
pushed a commit
that referenced
this pull request
Nov 27, 2026
…sion #1286 was one commit whose parent was a fresh main but whose tree came from an old worktree. It undid seven merged pull requests, and every gate was green: the squash was CLEAN and the old code was self-consistent. #1310 nearly did the same that day. The diff reads as a feature that also deletes things. What gives it away is that each file's new content is a version main already had and moved past. `stale tree guard` (stale-tree-guard.yml) walks each changed file's history on main and names the commits a return would undo. A file brought back with the content it had before main deleted it is the same finding. Deletions alone are not findings. It is graded on main's own history: - three or more source files returning fails; - fewer warn (#1302 deliberately took back two lines of #877); - screenshot baselines are reported and never counted (#1298's CTA baseline landed on old bytes). Replayed against #1286's commit and main's last 40 merges, each on its true parent: - #1286 fails, on 33 source files; - so does #1300, the restore, its mirror image, a revert that would carry `revert-ok`; - three merges warn; - the other 35 are silent. The self-test runs first in the job. It covers the #1286 shape, a partial revert, a baseline on old bytes, a genuine change, both exemptions (a `Revert…` title and the `revert-ok` label) and a shallow clone, which is refused rather than passed. The check is not required yet, by the order the ci-and-supply-chain skill gives. Closes #1307 Co-Authored-By: Claude Opus 5.5 <[email protected]>
7 tasks done
athvin
added a commit
that referenced
this pull request
Nov 27, 2026
…sion (#1315) * wip: claim #1307 — flag a pull request whose files revert to an older main version * feat(ci): flag a pull request whose files return to an older main version #1286 was one commit whose parent was a fresh main but whose tree came from an old worktree. It undid seven merged pull requests, and every gate was green: the squash was CLEAN and the old code was self-consistent. #1310 nearly did the same that day. The diff reads as a feature that also deletes things. What gives it away is that each file's new content is a version main already had and moved past. `stale tree guard` (stale-tree-guard.yml) walks each changed file's history on main and names the commits a return would undo. A file brought back with the content it had before main deleted it is the same finding. Deletions alone are not findings. It is graded on main's own history: - three or more source files returning fails; - fewer warn (#1302 deliberately took back two lines of #877); - screenshot baselines are reported and never counted (#1298's CTA baseline landed on old bytes). Replayed against #1286's commit and main's last 40 merges, each on its true parent: - #1286 fails, on 33 source files; - so does #1300, the restore, its mirror image, a revert that would carry `revert-ok`; - three merges warn; - the other 35 are silent. The self-test runs first in the job. It covers the #1286 shape, a partial revert, a baseline on old bytes, a genuine change, both exemptions (a `Revert…` title and the `revert-ok` label) and a shallow clone, which is refused rather than passed. The check is not required yet, by the order the ci-and-supply-chain skill gives. Closes #1307 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: bmoore813 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
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 #993
The
merge_previewjob (podmaterialize_previews→ controlpublish_previews),er_golden::scoped_masters_sqlwith plan vectors, five snapshot-pinned lake statements, themerge_preview_watermarkscheckpoint, the generate route, work-order injection, and the as-built contract inconnectors.md§4.3.#993: materialize merge previews from resolution results and persist them for approval — the half #1305 left. Together with #1296 and #1305 this completes #993's acceptance except the items listed as v1 limits.
Proof
pg_merge_preview_dag(DuckLake + executor harness): a provenanced crm in-source duplicate pair yields exactly one 2-member Contact preview; the matching uploaded webforms row never joins; no-policy generate is a no-op; regeneration changes nothing; the checkpoint advances. It first failed on a real bug in my generate key (it ignored policy revisions) — fixed.er-sql-check: scoped election plans for 5 policies × protect.cargo test -p er-server --test mainagainst Postgres: 157 passed.make check: exit 0.Risk & rollback
Opt-in: nothing runs without a writeback policy and a generate call; no external writes.
git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onbrians-MacBook-Pro· 2026-11-27T05:45:16Zmainis 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: — fa61df4, rust 45946303779 + frontend 45946303698 success
imagesbuilt, or correctly never ran because nothing that goes intoan image changed: — success, run 45946303689
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: — run 45946702312 success; the live process serves the new route:
https://dupezero.com/api/openapilists/merge-previews/generate, which only the new image hasdeploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: — deploy, infra, devcontainer, marketing preview all success on fa61df4; drift/kind are scheduled, not merge-triggered
Donethrough the automation rather than byhand, and the issue closed: — E9: Materialize merge previews and persist approval #993 CLOSED by feat(writeback): materialize Salesforce merge previews from resolution results (#993) #1310 via automation
(a skill, a reference, memory) — or nothing new was learned: — memory
stale-tree-commit-reverts-main: the first push of this PR squashed withreset --soft origin/mainonto a newer main and reverted ~3k lines of marketing work; caught by a webkit baseline failure, rebuilt bygit merge-treebefore mergeSpecific to this change
merge_preview_watermarks— the new pod serves (boot reconcile refuses to start on a failed apply, and the old image lacks the route), run 45946702312Context — plan, discoveries, measurements, files
Plan
Discoveries
BEGIN/COMMIT.(snapshot_end, run id)without an entity resume: a job stops at a run boundary once 200 groups are built, always finishing at least one run.Measurements
Files
🤖 Generated with Claude Code