···11+/**
22+ * Pure utility functions extracted from db.ts for use in tests
33+ * and other contexts that don't need the full TanStack DB setup.
44+ */
55+66+import type { Revision } from "@/schemas";
77+88+/** Key function that handles divergent changes (same change_id, different commits) */
99+export function getRevisionKey(revision: Revision): string {
1010+ if (revision.divergent_index != null) {
1111+ return `${revision.change_id}/${revision.divergent_index}`;
1212+ }
1313+ return revision.change_id;
1414+}