importCottonKitimport XCTest@testable importCottonUI/// The phone reports its own hitches (fanperf, owner 15 Oct 2026: "the/// animations must never make the app heavy; prove it, keep it proven"): a/// MetricKit payload's four figures go to the core as the device's usage and/// land on its row, and nothing else of the payload is written anywhere.finalclassUsageReporterTests: XCTestCase {/// A core that keeps every request it was asked.privatefinalclassTold: CottonCalling, @unchecked Sendable {var asked: [(method: String, body: String)] = []func callRaw(_ method: String, requestJSON: String) asyncthrows -> String { asked.append((method, requestJSON))return #"{"ok":true,"data":{"said":true}}"# }func subscribe(_ handler: @escaping @Sendable (CottonEvent) -> Void) {}func close() {} }/// RULE: Nothing of a MetricKit payload is logged or written outside the device's row — the reporter has no log, print, file write or payload dump of its own, so the owner's usage lives only as the four numbers the definition shows.func testNothingOfThePayloadIsLogged() throws {let source = SourceSweep.withoutComments(trySourceSweep.mustRead("apps/cotton/Sources/CottonUI/Diagnostics/UsageReporter.swift", ownedBy: "fanperf"))for spoken in ["Logger", "print(", "NSLog", "os_log", "Log.", "debugPrint", "dump(", "jsonRepresentation", "dictionaryRepresentation", ".write(", "FileManager"] { XCTAssertFalse(source.contains(spoken), "UsageReporter writes `\(spoken)` — a payload goes only to diagnostics.say") } }}