T-2431 / draft PR #258: UTC ISO timestamp names with safe collisions and legacy recovery discovery.
Ready to push
4 synthetic filename checks and 15 focused simulator backup/scheduler tests pass, with zero failures/skips. Mac build-for-testing, strict lint and configuration/ownership guards pass. Four source reviews found no actionable issues. No full UI suite, deployment, production launch or live data/cloud operation was performed.
New backups use names such as transit-20261011T020000Z.transitbackup. Existing backups retain their names.
One UTC formatter serves manual, scheduled and safety backups. Whole-second collisions use readable numbered suffixes. Legacy recovery discovery remains available.
lstat reserves broken symlinks and directories. Advisory name selection is backed by an atomic exclusive rename, preventing publication from replacing a racing backup. Native save dialogs retain user-directed replacement behavior.
Transit/Transit/Services/Backups/BackupFilename.swift
Why it matters. Consistent useful names across all user-visible backup paths.
What to look at. BackupFilename.name(at:)
Transit/Transit/Services/Backups/DurableBackupFile.swift
Why it matters. Advisory filename selection cannot prevent another file arriving before publication.
What to look at. DurableBackupFile.publish
Transit/Transit/Services/Backups/BackupRecoveryFiles.swift
Why it matters. Old safety backups remain accessible without a migration.
What to look at. BackupRecoveryFiles.available(in:)
Source: local run at 2026-10-11T11:12:46.360035+00:00 · snapshot e15c12373cb94cc0db7673b7d769b673487775f3 (dirty working tree)
Baseline: none
Execution: passed · JUnit: 2 files · Coverage: none · Baseline: absent
Coverage scope: as the project configures it
Totals: 19 passed · 0 failed · 0 skipped · 0 errored · 0 flaky
Derived by declaration name, from the diff (no baseline run).
No new or removed test declarations.
Files that import a changed file on the left, changed files in the centre, files a changed file imports on the right. Snapshot working-tree against base e15c12373cb94cc0db7673b7d769b673487775f3.
13 files: 8 code · 5 docs. Click to expand.
diff --git a/Transit/Transit/Services/Backups/BackupRecoveryFiles.swift b/Transit/Transit/Services/Backups/BackupRecoveryFiles.swiftindex d03e1c93..190d8adc 100644--- a/Transit/Transit/Services/Backups/BackupRecoveryFiles.swift+++ b/Transit/Transit/Services/Backups/BackupRecoveryFiles.swift@@ -6,11 +6,10 @@ nonisolated enum BackupRecoveryFiles { appropriateFor: nil, create: true).appendingPathComponent("Backups") } - static func newURL(beforeWipe: Bool = false) throws -> URL {+ static func newURL() throws -> URL { let folder = try directory() try FileManager.default.createDirectory(at: folder, withIntermediateDirectories: true)- let prefix = beforeWipe ? "BeforeWipe-" : "BeforeImport-"- return folder.appendingPathComponent("\(prefix)\(UUID().uuidString).transitbackup")+ return try BackupFilename.availableURL(in: folder) } /// Only published recovery files owned by this feature, never arbitrary app-private files.@@ -23,9 +22,11 @@ nonisolated enum BackupRecoveryFiles { } catch CocoaError.fileReadNoSuchFile { return [] } return try entries.filter { url in let name = url.deletingPathExtension().lastPathComponent+ let legacy = ["BeforeImport-", "BeforeWipe-"].contains { prefix in+ name.hasPrefix(prefix) && UUID(uuidString: String(name.dropFirst(prefix.count))) != nil+ } guard url.pathExtension == "transitbackup",- let prefix = ["BeforeImport-", "BeforeWipe-"].first(where: name.hasPrefix),- UUID(uuidString: String(name.dropFirst(prefix.count))) != nil else { return false }+ legacy || BackupFilename.isGenerated(url.lastPathComponent) else { return false } let values = try url.resourceValues(forKeys: [.isRegularFileKey, .isSymbolicLinkKey]) return values.isRegularFile == true && values.isSymbolicLink != true }.sorted { $0.lastPathComponent < $1.lastPathComponent }
diff --git a/Transit/Transit/Services/Backups/BackupScheduler.swift b/Transit/Transit/Services/Backups/BackupScheduler.swiftindex 12df9571..99983a33 100644--- a/Transit/Transit/Services/Backups/BackupScheduler.swift+++ b/Transit/Transit/Services/Backups/BackupScheduler.swift@@ -59,9 +59,9 @@ final class BackupScheduler { if let renewed = access.renewedBookmark { defaults.set(renewed, forKey: "backup.directoryBookmark") }- let name = "Transit-\(Int(now.timeIntervalSince1970))-\(UUID().uuidString).transitbackup"+ let destination = try await writer.newDestination(in: access.url, at: now) let archive = try service.capture()- _ = try await writer.export(archive, to: access.url.appendingPathComponent(name))+ _ = try await writer.export(archive, to: destination) lastSuccess = now defaults.set(now, forKey: "backup.lastSuccess") lastError = nil
diff --git a/Transit/Transit/Services/Backups/DatabaseBackupIO.swift b/Transit/Transit/Services/Backups/DatabaseBackupIO.swiftindex 8ef8531c..e1c343c9 100644--- a/Transit/Transit/Services/Backups/DatabaseBackupIO.swift+++ b/Transit/Transit/Services/Backups/DatabaseBackupIO.swift@@ -71,6 +71,10 @@ actor DatabaseBackupWriter { self.operation = operation } + func newDestination(in directory: URL, at date: Date) throws -> URL {+ try BackupFilename.availableURL(in: directory, at: date)+ }+ func export(_ archive: DatabaseArchive, to url: URL) throws -> DatabaseArchive { try operation(archive, url) }
diff --git a/Transit/Transit/Services/Backups/DurableBackupFile.swift b/Transit/Transit/Services/Backups/DurableBackupFile.swiftindex a28b7558..5c20da88 100644--- a/Transit/Transit/Services/Backups/DurableBackupFile.swift+++ b/Transit/Transit/Services/Backups/DurableBackupFile.swift@@ -31,9 +31,16 @@ nonisolated enum DurableBackupFile { try synchronizeDirectory(for: url) } - /// Same-directory rename atomically replaces the destination only after verification.+ /// Generated backup names never replace existing files, even if name selection raced. static func publish(_ staging: URL, to destination: URL) throws {- guard rename(staging.path, destination.path) == 0 else {+ let generated = BackupFilename.isGenerated(destination.lastPathComponent)+ let result = generated+ ? renamex_np(staging.path, destination.path, UInt32(RENAME_EXCL))+ : rename(staging.path, destination.path)+ guard result == 0 else {+ if generated && errno == EEXIST {+ throw DatabaseBackupError.invalidArchive("A backup already has this name. Try the export again.")+ } throw DatabaseBackupError.invalidArchive("The verified backup could not be saved at this destination.") } try synchronizeDirectory(for: destination)
diff --git a/Transit/Transit/Views/Settings/BackupRecoveryView.swift b/Transit/Transit/Views/Settings/BackupRecoveryView.swiftindex a5dccd97..a501e40b 100644--- a/Transit/Transit/Views/Settings/BackupRecoveryView.swift+++ b/Transit/Transit/Views/Settings/BackupRecoveryView.swift@@ -33,7 +33,7 @@ struct BackupRecoveryView: View { @State private var copying = false @State private var presenting = false @State private var document: TransitBackupDocument?- @State private var filename = "Recovery.transitbackup"+ @State private var filename = BackupFilename.name() private let writer = DatabaseBackupWriter() var body: some View {@@ -104,7 +104,7 @@ struct BackupRecoveryView: View { defer { if access { url.stopAccessingSecurityScopedResource() } } do { document = TransitBackupDocument(data: try await writer.verifiedFileData(url))- filename = url.lastPathComponent+ filename = BackupFilename.name() presenting = true } catch { message = error.localizedDescription } }
diff --git a/Transit/Transit/Views/Settings/DatabaseBackupView.swift b/Transit/Transit/Views/Settings/DatabaseBackupView.swiftindex 0b195ae8..0de95e9d 100644--- a/Transit/Transit/Views/Settings/DatabaseBackupView.swift+++ b/Transit/Transit/Views/Settings/DatabaseBackupView.swift@@ -91,7 +91,7 @@ struct DatabaseBackupView: View { .disabled(busy) .fileExporter( isPresented: $exporting, document: document, contentTypes: [.json],- defaultFilename: "Transit-\(Int(Date.now.timeIntervalSince1970)).transitbackup",+ defaultFilename: BackupFilename.name(at: exportedArchive?.createdAt ?? .now), onCompletion: handleExport, onCancellation: { preparingWipe = false@@ -218,7 +218,7 @@ extension DatabaseBackupView { defer { if access { url.stopAccessingSecurityScopedResource() } } guard let expected = exportedArchive else { throw DatabaseBackupError.changed } if preparingWipe {- let recovery = try BackupRecoveryFiles.newURL(beforeWipe: true)+ let recovery = try BackupRecoveryFiles.newURL() try await service.retainWipeRecovery(selectedURL: url, expected: expected, recoveryURL: recovery) wipeBackupURL = recovery wipeConfirmation = ""
diff --git a/Transit/Transit/Services/Backups/BackupFilename.swift b/Transit/Transit/Services/Backups/BackupFilename.swiftnew file mode 100644index 00000000..7579d1aa--- /dev/null+++ b/Transit/Transit/Services/Backups/BackupFilename.swift@@ -0,0 +1,36 @@+import Darwin+import Foundation++/// ISO 8601 basic notation avoids colons and other nonportable filename characters.+nonisolated enum BackupFilename {+ private static let style = Date.ISO8601FormatStyle(+ dateSeparator: .omitted, timeSeparator: .omitted, timeZoneSeparator: .omitted,+ includingFractionalSeconds: false, timeZone: TimeZone(secondsFromGMT: 0)!)++ static func name(at date: Date = .now) -> String {+ "transit-\(date.formatted(style)).transitbackup"+ }++ static func isGenerated(_ name: String) -> Bool {+ name.range(+ of: #"^transit-[0-9]{8}T[0-9]{6}Z(?:-(?:[2-9]|[1-9][0-9]+))?\.transitbackup$"#,+ options: .regularExpression) != nil+ }++ /// Name selection is advisory. Publication must also refuse replacement atomically.+ static func availableURL(in directory: URL, at date: Date = .now) throws -> URL {+ let base = name(at: date)+ for attempt in 1...1000 {+ let filename = attempt == 1 ? base+ : String(base.dropLast(".transitbackup".count)) + "-\(attempt).transitbackup"+ let url = directory.appendingPathComponent(filename)+ var info = stat()+ if lstat(url.path, &info) == 0 { continue }+ guard errno == ENOENT else {+ throw DatabaseBackupError.invalidArchive("The backup destination could not be checked.")+ }+ return url+ }+ throw DatabaseBackupError.invalidArchive("Too many backups have the same timestamp. Try the export again.")+ }+}
diff --git a/tests/backup-filenames/Probe.swift b/tests/backup-filenames/Probe.swiftnew file mode 100644index 00000000..86e064fd--- /dev/null+++ b/tests/backup-filenames/Probe.swift@@ -0,0 +1,105 @@+import Foundation++/// Standalone filename checks: no app, model container, defaults or cloud access.+@main struct BackupFilenameProbe {+ struct Failure: Error { let message: String }++ static func main() throws {+ var passed: [String] = []+ let date = Date(timeIntervalSince1970: 1_791_684_000)+ let name = "transit-20261011T020000Z.transitbackup"+ try checkFormat(date: date, name: name)+ passed.append("UTC ISO timestamp and exact archive extension")++ let folder = try makeFolder()+ defer { try? FileManager.default.removeItem(at: folder) }+ let first = try BackupFilename.availableURL(in: folder, at: date)+ let original = Data("existing backup".utf8)+ try original.write(to: first)+ let second = try BackupFilename.availableURL(in: folder, at: date)+ try expect(second.lastPathComponent == "transit-20261011T020000Z-2.transitbackup", "Readable collision suffix")+ try FileManager.default.createSymbolicLink(+ at: second, withDestinationURL: folder.appendingPathComponent("missing"))+ let third = try BackupFilename.availableURL(in: folder, at: date)+ try expect(third.lastPathComponent == "transit-20261011T020000Z-3.transitbackup",+ "Broken symlink counts as occupied")+ try expect(BackupFilename.isGenerated(third.lastPathComponent), "Collision name recognized")+ try expect(try Data(contentsOf: first) == original, "Name selection preserves existing backup")+ passed.append("Numbered collisions and occupied symlinks")++ let staging = folder.appendingPathComponent("scratch")+ let replacement = Data("new backup".utf8)+ try replacement.write(to: staging)+ // Simulate a competing writer arriving after availableURL returned.+ try original.write(to: third)+ do {+ try DurableBackupFile.publish(staging, to: third)+ throw Failure(message: "Publication replaced a competing backup")+ } catch is DatabaseBackupError {+ try expect(try Data(contentsOf: third) == original, "Atomic collision preserves destination")+ try expect(try Data(contentsOf: staging) == replacement, "Failed publication preserves staging")+ }+ try FileManager.default.removeItem(at: third)+ try DurableBackupFile.publish(staging, to: third)+ try expect(try Data(contentsOf: third) == replacement, "Unoccupied generated destination publishes")+ passed.append("Atomic no-overwrite publication after selection race")++ try checkDiscovery(in: folder, first: first, third: third, original: original)+ passed.append("Legacy and new recovery discovery without migration")++ try writeJUnit(passed)+ print("\(passed.count) filename checks passed. Example: \(name)")+ }++ private static func checkDiscovery(in folder: URL, first: URL, third: URL, original: Data) throws {+ let legacy = folder.appendingPathComponent("BeforeImport-\(UUID()).transitbackup")+ try original.write(to: legacy)+ let legacyWipe = folder.appendingPathComponent("BeforeWipe-\(UUID()).transitbackup")+ try original.write(to: legacyWipe)+ let unknown = folder.appendingPathComponent("unrelated.transitbackup")+ try original.write(to: unknown)+ let directoryName = folder.appendingPathComponent("transit-20261011T020001Z.transitbackup")+ try FileManager.default.createDirectory(at: directoryName, withIntermediateDirectories: false)+ let listed = Set(try BackupRecoveryFiles.available(in: folder))+ let expectedNames = Set([first, third, legacy, legacyWipe].map(\.lastPathComponent))+ try expect(Set(listed.map(\.lastPathComponent)) == expectedNames,+ "Legacy/new files only; symlinks/directories excluded")+ try expect(try Data(contentsOf: legacy) == original, "Legacy backups not renamed or modified")+ }++ private static func makeFolder() throws -> URL {+ let folder = FileManager.default.temporaryDirectory.appendingPathComponent(UUID().uuidString)+ try FileManager.default.createDirectory(at: folder, withIntermediateDirectories: true)+ return folder.resolvingSymlinksInPath()+ }++ private static func writeJUnit(_ passed: [String]) throws {+ if CommandLine.arguments.count > 1 {+ let rows = passed.map { "<testcase classname=\"BackupFilenameProbe\" name=\"\($0)\"/>" }.joined()+ let xml = "<testsuite name=\"Backup filenames\" tests=\"\(passed.count)\" failures=\"0\" errors=\"0\">"+ + rows + "</testsuite>"+ try xml.write(toFile: CommandLine.arguments[1], atomically: true, encoding: .utf8)+ }+ }++ private static func expect(_ condition: Bool, _ message: String) throws {+ guard condition else { throw Failure(message: message) }+ }++ private static func checkFormat(date: Date, name: String) throws {+ try expect(BackupFilename.name(at: date) == name, "Exact UTC ISO name")+ try expect(BackupFilename.name(at: date.addingTimeInterval(0.9)) == name, "Whole-second resolution")+ let parser = ISO8601DateFormatter()+ parser.formatOptions = [.withInternetDateTime]+ let offsetDate = try unwrap(parser.date(from: "2026-10-11T13:00:00+11:00"))+ try expect(BackupFilename.name(at: offsetDate) == name, "Offset input must normalize to UTC")+ try expect(BackupFilename.isGenerated(name), "Generated name recognized")+ try expect(!name.contains(":"), "Filename must avoid colons")+ try expect(!BackupFilename.isGenerated("transit-random.transitbackup"), "Unknown names excluded")+ }++ private static func unwrap<T>(_ value: T?) throws -> T {+ guard let value else { throw Failure(message: "Unable to parse fixture date") }+ return value+ }+}
diff --git a/docs/database-backups.md b/docs/database-backups.mdindex 2d190f0c..2775fe4b 100644--- a/docs/database-backups.md+++ b/docs/database-backups.md@@ -31,3 +31,9 @@ User testing found `Operation not permitted` when creating the scheduled staging Folder selection holds the system security scope while creating a bookmark and checking an exclusive disposable staging file on the background executor (write, full file flush, directory flush, removal). Only success replaces the previous folder/bookmark. Scheduler resolution retains the scope until its background verified publication finishes, renews stale bookmarks while scoped, and closes access on every completion/error path. Existing schedule/defaults values and catch-up/retry semantics remain unchanged. A native time-only field with stepper replaces the hour/minute menus, supports keyboard entry and the system locale’s 12/24-hour format. A neutral date anchor represents only wall-clock fields; schedule execution still uses the Mac’s local calendar including its existing DST policy. Focused unit fixtures and configuration guards are distinct from native selection/relaunch acceptance; validation results are recorded in the implementation record.++## Readable backup filenames — 2026-10-11++Following confirmed user acceptance of Mac scheduling, new manual exports, scheduled exports, import/wipe safety files and saved recovery copies use `transit-(iso-datetime).transitbackup`. The timestamp is UTC ISO 8601 basic notation (`YYYYMMDDTHHMMSSZ`), at whole-second resolution; for example `transit-20261011T020000Z.transitbackup`. Basic notation avoids colon restrictions across file providers and operating systems. `Z` explicitly denotes UTC; filenames represent export/safety-file creation, while the archive retains its own creation timestamp. Hidden staging files remain opaque locked internal files and are not published backups.++Generated destinations choose a readable `-2`, `-3`, etc. suffix only on collision. Name availability is advisory: final generated-name publication uses an atomic exclusive rename and refuses a racing collision rather than replacing another backup. Manual system save dialogs retain their ordinary user-directed duplicate-name handling. Existing BeforeImport/BeforeWipe UUID files remain discoverable and are never renamed; new timestamp-named safety files are also recognized. No backup settings or stored data change.
diff --git a/specs/full-database-backups/decision_log.md b/specs/full-database-backups/decision_log.mdindex 5a7ee526..84c954df 100644--- a/specs/full-database-backups/decision_log.md+++ b/specs/full-database-backups/decision_log.md@@ -64,3 +64,9 @@ User testing found `Operation not permitted` when creating the scheduled staging Folder selection holds the system security scope while creating a bookmark and checking an exclusive disposable staging file on the background executor (write, full file flush, directory flush, removal). Only success replaces the previous folder/bookmark. Scheduler resolution retains the scope until its background verified publication finishes, renews stale bookmarks while scoped, and closes access on every completion/error path. Existing schedule/defaults values and catch-up/retry semantics remain unchanged. A native time-only field with stepper replaces the hour/minute menus, supports keyboard entry and the system locale’s 12/24-hour format. A neutral date anchor represents only wall-clock fields; schedule execution still uses the Mac’s local calendar including its existing DST policy. Focused unit fixtures and configuration guards are distinct from native selection/relaunch acceptance; validation results are recorded in the implementation record.++## Readable backup filenames — 2026-10-11++Following confirmed user acceptance of Mac scheduling, new manual exports, scheduled exports, import/wipe safety files and saved recovery copies use `transit-(iso-datetime).transitbackup`. The timestamp is UTC ISO 8601 basic notation (`YYYYMMDDTHHMMSSZ`), at whole-second resolution; for example `transit-20261011T020000Z.transitbackup`. Basic notation avoids colon restrictions across file providers and operating systems. `Z` explicitly denotes UTC; filenames represent export/safety-file creation, while the archive retains its own creation timestamp. Hidden staging files remain opaque locked internal files and are not published backups.++Generated destinations choose a readable `-2`, `-3`, etc. suffix only on collision. Name availability is advisory: final generated-name publication uses an atomic exclusive rename and refuses a racing collision rather than replacing another backup. Manual system save dialogs retain their ordinary user-directed duplicate-name handling. Existing BeforeImport/BeforeWipe UUID files remain discoverable and are never renamed; new timestamp-named safety files are also recognized. No backup settings or stored data change.
diff --git a/specs/full-database-backups/design.md b/specs/full-database-backups/design.mdindex 78a853ae..b99c9eae 100644--- a/specs/full-database-backups/design.md+++ b/specs/full-database-backups/design.md@@ -79,3 +79,9 @@ User testing found `Operation not permitted` when creating the scheduled staging Folder selection holds the system security scope while creating a bookmark and checking an exclusive disposable staging file on the background executor (write, full file flush, directory flush, removal). Only success replaces the previous folder/bookmark. Scheduler resolution retains the scope until its background verified publication finishes, renews stale bookmarks while scoped, and closes access on every completion/error path. Existing schedule/defaults values and catch-up/retry semantics remain unchanged. A native time-only field with stepper replaces the hour/minute menus, supports keyboard entry and the system locale’s 12/24-hour format. A neutral date anchor represents only wall-clock fields; schedule execution still uses the Mac’s local calendar including its existing DST policy. Focused unit fixtures and configuration guards are distinct from native selection/relaunch acceptance; validation results are recorded in the implementation record.++## Readable backup filenames — 2026-10-11++Following confirmed user acceptance of Mac scheduling, new manual exports, scheduled exports, import/wipe safety files and saved recovery copies use `transit-(iso-datetime).transitbackup`. The timestamp is UTC ISO 8601 basic notation (`YYYYMMDDTHHMMSSZ`), at whole-second resolution; for example `transit-20261011T020000Z.transitbackup`. Basic notation avoids colon restrictions across file providers and operating systems. `Z` explicitly denotes UTC; filenames represent export/safety-file creation, while the archive retains its own creation timestamp. Hidden staging files remain opaque locked internal files and are not published backups.++Generated destinations choose a readable `-2`, `-3`, etc. suffix only on collision. Name availability is advisory: final generated-name publication uses an atomic exclusive rename and refuses a racing collision rather than replacing another backup. Manual system save dialogs retain their ordinary user-directed duplicate-name handling. Existing BeforeImport/BeforeWipe UUID files remain discoverable and are never renamed; new timestamp-named safety files are also recognized. No backup settings or stored data change.
diff --git a/specs/full-database-backups/implementation.md b/specs/full-database-backups/implementation.mdindex e868d03f..1f87ae93 100644--- a/specs/full-database-backups/implementation.md+++ b/specs/full-database-backups/implementation.md@@ -113,3 +113,16 @@ Native acceptance uses a separately signed Development-derived synthetic probe c The native field’s screenshot correctly shows initial 02:00 and keyboard-edited 23:45 matching stored wall-clock fields. The automation’s accessibility Date rendering applies the host time zone, initially showing 13:00; this is not the visible picker display. A provisional AppKit wrapper was discarded after screenshot verification, retaining the simpler native SwiftUI field. Current native 24-hour display is verified; changing the probe’s locale environment alone did not override this host’s clock presentation, so native 12-hour display is not independently verified. The control delegates formatting to the system’s native picker. No global region/clock preferences, existing Development settings, live data, production app, cloud account or device installation changed. Evidence: `/tmp/transit-scheduled-folder-tests.xcresult` contains the 30 passing domain tests; the Mac compilation/signing logs and synthetic native probe inputs/signature check remain under `/tmp/transit-scheduled-folder-*`. Native UI state and screenshots establish actual picker selection, keyboard entry and persisted-bookmark publication; bookmark mocks are not counted as native acceptance.+++## 2026-10-11 readable backup filenames++Beginner: new exports and recovery copies use UTC ISO 8601 filenames such as `transit-20261011T020000Z.transitbackup`. Existing backups retain their names. `Z` makes the timezone explicit; basic ISO notation avoids filesystem-reserved colons.++Intermediate: one formatter supplies manual exports, scheduled exports, private import/wipe safety backups and recovery-copy suggestions. Whole-second collisions use readable `-2`, `-3` suffixes. Legacy BeforeImport/BeforeWipe files remain discoverable alongside new names, without migration or settings changes.++Expert: destination selection uses `lstat` so broken symlinks and directories reserve names. Selection is advisory; generated-file publication uses atomic exclusive rename to prevent overwriting a backup that arrives after selection. Scheduled selection runs on the existing writer actor while folder authorization stays open. Explicit custom export destinations retain the existing replacement contract; native save dialogs retain their user-directed collision handling.++Completeness: source and focused synthetic filename checks are implemented. Four standalone filename checks pass, covering exact UTC normalization/extension, readable collisions including broken symlinks, an atomic publication race and legacy/new recovery discovery. The fixture uses disposable files only, without an app, database, defaults or cloud access. Its initial discovery comparison incorrectly treated macOS temporary-directory aliases (`/var` and `/private/var`) as different files; comparison now checks the returned filenames within the same disposable folder. No production change was needed for this fixture correction. The requested focused simulator BackupSchedulerTests and DatabaseBackupTests pass: 15 tests, zero failures/skips. Mac Debug build-for-testing succeeds without launch (`CODE_SIGNING_ALLOWED=NO`, development cloud sync disabled). Strict no-cache SwiftLint, configuration and model-ownership guards, and diff whitespace checks pass. Four source review perspectives found no actionable issue. No Mac runtime or full UI suite is included. Evidence: `/tmp/transit-backup-filename-tests.xcresult`, `/tmp/transit-backup-filename-mac-build.log` and standalone JUnit inputs under `/tmp/transit-backup-filename-review`.++Acceptance status: the user confirmed phone import/wipe and Mac scheduled backup. Earlier focused domain, compilation, signing and synthetic persisted-bookmark evidence remain applicable to unchanged behavior. Native recovery-copy cancellation/retry, native 12-hour clock presentation and near-limit archive performance remain optional coverage gaps; remote-provider upload completion and concurrent offline-device behavior retain their documented platform limits.
diff --git a/specs/full-database-backups/requirements.md b/specs/full-database-backups/requirements.mdindex 35a6c742..44f4c480 100644--- a/specs/full-database-backups/requirements.md+++ b/specs/full-database-backups/requirements.md@@ -82,3 +82,9 @@ Transit needs recoverable copies of all stored application data before a user re - Folder selection must obtain persistent read/write access through the normal user-selected-folder grant, validate creation/flush/removal of its own disposable file, and leave the previous saved folder unchanged on failure. No Full Disk Access or global folder permission is requested. Scheduled work must retain security scope across asynchronous publication and restore it from the bookmark after relaunch. - Daily time uses a native Mac time-only field with keyboard entry, an accessible label, and system-locale 12/24-hour formatting. Existing saved hour/minute values, local-time DST handling, running-app limits and catch-up behavior remain unchanged. - Native folder selection and bookmark use after process termination must be verified separately from injected bookmark fixtures; any unavailable native acceptance remains explicitly reported.++## Readable backup filenames — 2026-10-11++Following confirmed user acceptance of Mac scheduling, new manual exports, scheduled exports, import/wipe safety files and saved recovery copies use `transit-(iso-datetime).transitbackup`. The timestamp is UTC ISO 8601 basic notation (`YYYYMMDDTHHMMSSZ`), at whole-second resolution; for example `transit-20261011T020000Z.transitbackup`. Basic notation avoids colon restrictions across file providers and operating systems. `Z` explicitly denotes UTC; filenames represent export/safety-file creation, while the archive retains its own creation timestamp. Hidden staging files remain opaque locked internal files and are not published backups.++Generated destinations choose a readable `-2`, `-3`, etc. suffix only on collision. Name availability is advisory: final generated-name publication uses an atomic exclusive rename and refuses a racing collision rather than replacing another backup. Manual system save dialogs retain their ordinary user-directed duplicate-name handling. Existing BeforeImport/BeforeWipe UUID files remain discoverable and are never renamed; new timestamp-named safety files are also recognized. No backup settings or stored data change.