Skip to content

E9: merge-preview persistence and the approval API #1305

Done

Description

@athvin

Child of #514; first half of #993 (the materialization job is the second half and closes #993).

Acceptance

  • Postgres entities: writeback_policy (append-only; its row id is the policy revision), merge_preview (immutable proposal content + status), merge_preview_journal (append-only transitions), merge_preview_watermark (compare-and-set checkpoint).
  • PersistedProposalV1 in writeback.rs: persisted input re-validated through MergeProposal::build (never deserialized as validated); pinned byte/fingerprint fixture; absent vs explicit null kept distinct.
  • Routes: PUT …/writeback/policies (admin), GET …/merge-previews, GET …/merge-previews/{id} (viewer), POST …/merge-previews/{id}/approve|reject (steward) with {fingerprint, reason?}, deny_unknown_fields.
  • Approval is an atomic compare-and-set on (id, fingerprint, status='planned') with a journal row in the same transaction; same decision repeated is idempotent; stale fingerprint, decided preview or a no-longer-active policy is 409; cross-org/dataset 404. No external call.
  • Postgres-tier tests; make check.

Activity

  1. added
    salesforce-launch
    on Nov 27, 2026
  2. self-assigned this
    on Nov 27, 2026
  3. added
    needs-review
    on Nov 27, 2026
  4. added
    pruned
    and removed
    needs-review
    pruned
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

salesforce-launch

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions