feat(cloud): retract the stale cloud row of a superseded continuation - #701
Merged
Merged
Conversation
The continuation election demotes a compacted conversation's old sibling out of the roster, but its Team Sessions row lingered until the retention window aged it out — teammates kept seeing two rows for one conversation while the owner's sidebar showed one. The vanished sweep now runs a second reconcile: a push-marked id that left the roster because the imported cache reports it SUPERSEDED (row present, strictly newer sibling exists — never inferred from absence) is retracted only when the family's listable winner is itself replay-pushed to the same org, under the same two-strike deferral as the vanished path. Deliberate content tradeoff, stated for review: the demoted row is the only cloud replay of the pre-compact detail; the winner carries the compacted continuation. The source transcript stays on the owner's disk and can be re-shared at any time. A failed status lookup reads as unknown, never superseded, and ids absent from the cache stay on the vanished path's evidence rules. Pre-commit hook ran. Total eslint: 18, total circular: 0
Collaborator
Author
|
The dual-instance real-machine cell flagged in the PR body has now RUN (Windows, managed Cloud, integration build of #697+#698+#700+#701 on develop — the four branches also merge conflict-free):
Same run also exercised #698 (a garbage entry injected into the real pushCursors + accessSettings stores; boot shed only the garbage — all 39 real cursors survived, no reset, no retract wave) and #700 (cadence counter hand-set to 64 on a live 1000+-event session: the next pass took one full authoritative read, still APPENDED at the same epoch, and restarted the counter at zero — the counter had already advanced to 1 through natural passes beforehand). |
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.
Problem
#693 dedupes compacted continuation families locally ("only the newest sibling is listable"), but the demoted sibling's cloud row lingers until the retention window ages it out. Teammates' Team Sessions keep showing two rows for one conversation while the owner's sidebar shows one — the stale duplicate the local dedupe was built to remove.
Solution
The vanished sweep gains a second reconcile pass, with strictly positive evidence:
imported_history_continuation_statusescommand reports, for push-marked ids, whether the imported cache holds the row AND a strictly newer continuation sibling exists (cached_session_continuation_status_from_conn), plus the elected lineage id. Absence from the cache is "unknown", never "superseded" — a rebuilding cache cannot trigger this path, unlike absence-based evidence.hasReplayPushed: cursor with pushedCount > 0), under the same two-strike deferral as the vanished path, with its own audit verb:cloud retract [superseded continuation](matched by the existing destructive-effect audit grep).Deliberate content tradeoff (please review this explicitly)
The demoted row is the only cloud replay of the pre-compact detail; the winner carries the compacted continuation. Retracting it means teammates lose replay access to that detail (the compacted summary in the winner covers the conversation). The owner's source transcript is untouched and can be re-shared at any time. If the team prefers keeping historical epochs replayable, the alternative is documenting the lingering duplicate instead — this PR takes the "one canonical row per conversation" reading of #693's intent.
Verification
cargo test -p orgtrack_core --lib imported_history— 69 passed; scoped clippy clean;pnpm typecheckclean.