feat(core): add event revisions and saved-device local labels

Platform contract harnesses need monotonic event revisions for at-least-once
dedup and a typed rename API that survives listing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-11 04:47:28 +02:00
parent 89c2206f0f
commit 8e8cab9b24
13 changed files with 162 additions and 19 deletions

View File

@@ -70,7 +70,7 @@ final class ProgressDerivationTests: XCTestCase {
private func event(phase: String, kind: String, json: String) -> CoreEventModel {
CoreEventModel(
id: UUID().uuidString, timestamp: 0, scope: "transfer", transferId: 1,
id: UUID().uuidString, revision: 1, timestamp: 0, scope: "transfer", transferId: 1,
direction: "send", phase: phase, kind: kind, dataJson: json
)
}

View File

@@ -12,6 +12,7 @@ struct CoreStatus: Equatable, Sendable {
struct CoreEventModel: Equatable, Identifiable, Sendable {
let id: String
let revision: UInt64
let timestamp: Int64
let scope: String
let transferId: UInt64?

View File

@@ -521,7 +521,7 @@ private func withSecurityScopedAccess<T>(pathOrUrl: String, _ body: () throws ->
private extension CoreEvent {
func toModel() -> CoreEventModel {
CoreEventModel(
id: id, timestamp: timestamp, scope: scope, transferId: transferId,
id: id, revision: revision, timestamp: timestamp, scope: scope, transferId: transferId,
direction: direction, phase: phase, kind: kind, dataJson: dataJson
)
}