Repository navigation
feat(writeback): merge-preview persistence and the approval API (#1305) - #1308
Merged
Merged
Conversation
The first half of #993: a writeback proposal can be stored, inspected and approved through the tenant API, and an approval binds exactly one immutable proposal. Nothing here writes to Salesforce. - writeback_policies: append-only revisions per (connection, object) — allowlist, field mapping, election policy. A row id is the revision a preview binds; no policy means nothing is proposed. - merge_previews: immutable content (persisted proposal, field changes, snapshot, policy revision, fingerprint) plus decision columns; merge_preview_journal records every change in the same transaction. - PersistedProposalV1 stores the UNVALIDATED input; restoring always re-runs MergeProposal::build, with a pinned fingerprint fixture. - pg::publish_preview is idempotent on the fingerprint and supersedes the group's older planned preview; pg::decide_preview is a compare-and-set on (id, fingerprint, planned). - Routes: PUT/GET …/writeback/policies, GET …/merge-previews[/{id}], POST …/merge-previews/{id}/approve|reject {fingerprint, reason?}. Stale fingerprint, decided preview, replaced policy or inactive connection → 409; repeat decision → idempotent 200; cross-org → 404. The materialization job that produces previews from lake results is the second half and closes #993. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 27, 2026 04:39 — with
GitHub Actions
Inactive
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 #1305
Three Postgres entities (
writeback_policies,merge_previews,merge_preview_journal, 9 statements),PersistedProposalV1,pg::publish_preview/decide_preview, and five routes for policies, preview listing/detail and approve/reject. First half of #993.E9 (#514) needs approval to bind an exact immutable proposal before any provider write (#995). The watermark entity moves to the materialization PR, where its consumer lives.
Proof
pg_merge_preview_api: policy roles/validation/append-only, idempotent publish, supersede, viewer read, steward decide, unknown body field 422, stale fingerprint 409, approve twice 200, reject-after-approve 409, cross-org 404, journal shows only real changes, replaced policy blocks approval.writebackunit tests: round-trip to the same fingerprint, pinned fingerprint, unknown format and invalid input refused.cargo test -p er-server --test mainagainst Postgres: 156 passed. Frontend unit suite: 1117 passed.make check: exit 0.Risk & rollback
Additive tables and routes; no external effect. Revert leaves empty tables.
Post-merge ledger
Closed by: agent · session
Claude Code:24d16c2e-fec6-49d8-9797-060338df4848onMac· 2026-11-27T04:50:27Zmainis 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:
bb0232cc— rust 45941203195, frontend 45941203186, infra 45941203613 successimagesbuilt, or correctly never ran because nothing that goes intoan image changed: 45941203214 success
deployconverged — proved by a line the running process emitted, notby the image digest and not by the workflow conclusion: deploy 45941574295 success (dev + prod); its atomic pre-upgrade schema-migrate created the three tables
deploy,drift,kind's nightly leg) is green, or knowingly red for a reason that is notthis change: drift/kind red for known reasons (Confirm the er-alerts email subscription and prove alert delivery #1056, kind probe red since 2026-11-10: KeyError 'token_hash' after the credential-omission fix #1106)
Donethrough the automation rather than byhand, and the issue closed: E9: merge-preview persistence and the approval API #1305 CLOSED via the merge
(a skill, a reference, memory) — or nothing new was learned: nothing new beyond the DATASET_SCOPED rule already in memory
Specific to this change
Context — plan, discoveries, measurements, files
Plan
Discoveries
Measurements
Files
🤖 Generated with Claude Code