Expand onboarding and adaptive keyboard intelligence

Add resilient usage analytics, OOBE gateway flows, clipboard semantic ranking, purchase recovery, style learning, and managed current-information search.
This commit is contained in:
Rocky
2026-08-22 16:33:18 +08:00
parent ac374631ae
commit e5a83843db
162 changed files with 23574 additions and 1013 deletions
@@ -81,4 +81,29 @@ final class AnalyticsAIOperationTests: XCTestCase {
XCTAssertEqual(terminalEvents.first?.executionMode, .local)
XCTAssertEqual(terminalEvents.first?.durationBucket, .oneToThreeSeconds)
}
func testCancelPersistsFailedWithCancelledCategory() async throws {
let repository = AnalyticsRepository(
configuration: AnalyticsRepositoryConfiguration(
databaseURL: try analyticsTemporaryDatabaseURL()
),
clock: AnalyticsTestWallClock(),
uuidGenerator: AnalyticsTestUUIDGenerator()
)
let client = LiveAnalyticsClient(
repository: repository,
context: analyticsTestContext,
monotonicClock: AnalyticsTestMonotonicClock()
)
client.startAIFeature(
.transcription,
executionMode: .managed
).cancel()
_ = await analyticsWaitForPendingEventCount(2, repository: repository)
let events = try await analyticsDecodePendingEvents(repository: repository)
XCTAssertEqual(events.map(\.eventType), [.aiFeatureStarted, .aiFeatureFailed])
XCTAssertEqual(events.last?.failureCategory, .cancelled)
}
}