Repository navigation
feat(backend): add durable conversation mutation receipts - #12472
undivisible merged 4 commits into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
0743dc1 to
240ed99
Compare
240ed99 to
8283cc5
Compare
|
Final verification for
Focused local proof remains 12/12 mutation tests, 40 focused conversation tests, 27 route-policy tests, pyright with 0 errors, generated OpenAPI/client checks current, and the repository pre-push gate green. This slice is backend/API-contract only, so no physical-device validation is required. It intentionally implements the durable idempotent title/starred mutation foundation as part of #9355; feed, tombstones, folders, and desktop outbox wiring remain follow-up slices. |
|
Thanks @aryanorastar — this is a well-constructed first slice of the #9355 mutation contract. Notes from review, then two decisions that should get maintainer sign-off before merge. What looks right:
Two decisions for a maintainer before merge:
Everything else ( by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
kodjima33
left a comment
There was a problem hiding this comment.
Solid backend contract slice (idempotency receipts for conversation mutations), well tested — but this is a new capability, not a bug fix, so approve-only per policy.
|
Follow-up on the earlier automated review of this head: the two items it left for maintainer sign-off — (1) receipt retention, since every unique No further concerns from automation on this head. The transactional receipt semantics in One forward-looking note for the #9355 follow-up slices: if unbounded receipt growth wasn't a conscious accept, it's worth tracking a TTL/cap decision before the desktop outbox wiring lands — that's what will multiply mutation ids per conversation in practice. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…on-mutation-contract # Conflicts: # backend/route_policy_manifest.yaml
|
Verified the new head
Two state notes, neither a concern: the earlier approval targets the pre-merge head, so the integrated head needs the usual maintainer confirmation before merge, and No new concerns from automation on this head, and nothing needed from you, @aryanorastar - thanks for keeping the slice current with By AI on behalf of David. Routine merge-integration verification - no urgent action requested; normal review queue applies. by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…on-mutation-contract # Conflicts: # desktop/macos/Desktop/Sources/Generated/OmiApi.generated.swift # desktop/windows/src/renderer/src/lib/omiApi.generated.ts # web/admin/lib/services/omi-api/omiApi.generated.ts # web/app/src/lib/omiApi.generated.ts # web/personas-open-source/src/lib/omiApi.generated.ts
|
Conflicts resolved on
Hand-resolving generated output would have produced files that no generator run reproduces, and the freshness checks would have caught it later at best. Instead I took Verified rather than assumed: Diff against Note on approval state: @kodjima33's approval targeted One CI note that is not this PR: |
kodjima33
left a comment
There was a problem hiding this comment.
feat(backend): durable conversation mutation receipts — feature not bug fix, stays approve-only per policy; CI all green, mergeStateStatus CLEAN (previously DIRTY, now resolved upstream), diff re-reviewed at new head 0832e9e.
|
Verified the new head
No new concerns from automation on this head; @kodjima33's approval covers it. The earlier forward-looking note stands for the #9355 follow-up slices: settle a receipts TTL/cap decision before the desktop outbox lands and starts multiplying mutation ids per conversation. by AI on behalf of David (@Git-on-my-level). |
|
Tracked the receipts retention question as #12783, since it has now been raised twice and would otherwise disappear when this merges. I verified the shape rather than restating the concern:
So it is growth in document count per live conversation, not leaked storage or payload bloat. Today that is bounded by how often a human renames or stars something; the outbox slice is what changes the rate, because it is the component that mints ids programmatically and retries them. Which is exactly why you flagged it as a before-the-outbox decision, and I agree. The issue lays out the three options and notes the part that makes it a real decision rather than a chore: a TTL is a correctness boundary, not just cleanup. Once a receipt expires, a retry of that id stops replaying and starts re-applying — so the TTL has to exceed the longest window in which a client might still retry, which the outbox's retry horizon determines. That is why I have not picked a number; it is a data-retention call that should be made deliberately rather than inferred from my preference. Nothing changes in this PR. The diff is unchanged, and #12783 is a follow-up rather than a blocker — the receipts behaviour here is correct as specified, it just needs a lifecycle decided before the thing that multiplies it arrives. |
|
Thanks @aryanorastar — filing #12783 is the right home for the retention question, and the verification you posted holds up against
Nothing further from automation on this head ( by AI on behalf of David — if you need David’s attention urgently, please @Git-on-my-level and escalate with |
…on-mutation-contract # Conflicts: # backend/route_policy_manifest.yaml
|
Merged The collision is structural rather than semantic, and worth naming since it will keep happening: main added Resolved by writing both entries out in full, then verifying the result rather than eyeballing it: parsed the manifest and diffed route keys against main — 149 entries here versus main's 148, exactly one added ( The five generated clients and Verified nothing PR-owned moved: Proof on this head: 12/12 mutation contract tests, 32/32 route-policy tests ( Approval state, same caveat as before: the approval targets 0832e9e, and both intervening changes were integration only — but it does not carry to this head automatically. |
Summary
Part of #9355.
This adds the first backend contract slice for reliable conversation sync:
POST /v1/conversations/{conversation_id}/mutationsendpointset_titleandset_starredoperationsWhy
Desktop clients can lose a response after the backend has already committed a write. Retrying a normal update is ambiguous: the client cannot tell whether it is applying the same intent once or a second time against newer state.
The durable receipt makes the mutation ID an idempotency boundary. A retry gets the originally committed result even if conversation processing or locking changed afterward. Reusing the same ID for different intent is rejected without mutating state.
Correctness guarantees
Scope
This is intentionally the first slice of #9355, not the whole epic. It establishes the durable mutation and conflict contract for title/starred changes. Folder mutations, the desktop outbox, change feed, and tombstones remain follow-up slices because their atomicity and derived folder-count behavior need separate treatment.
Test proof
12 passed— new mutation contract suite, covering changed/no-op writes, exact replay, replay after later state and lock changes, reused IDs, stale revisions, missing revisions, locked/missing conversations, HTTP 409 shape, and strict operation validation40 passed, 53 deselected— focused conversation regression suite27 passed— route policy inventory0 errors18 passed, 0 failed(8optional environment warnings)72files /415tests passed, plus5/5Moonshine tests714suites passedAn exploratory full-backend run also surfaced existing Deepgram retirement expectation failures in unchanged STT test files; the mutation-specific and neighboring conversation suites are green.
No physical-device validation is required for this backend-only contract slice.