Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Do not weaken these unless the user explicitly asks for a product change.
- **INV-11:** Failure thresholds intentionally stop bad runs: 5 consecutive failures or 20 total failures.
- **INV-12:** Deduplicate moves files to the macOS Trash only. Hard delete is not available in the production UI or executor commit path.
- **INV-13:** The dedupe audit receipt directory (`.organize_logs/`) is preflighted before any deletion. An unwritable destination aborts the commit with `ReceiptPreflightError` and zero files touched.
- **INV-14:** Pair-as-unit conflict resolution is **Keep-wins**: when either half of a RAW+JPEG or Live Photo HEIC+MOV pair has an effective Keep — explicit, automatic (the cluster's auto-suggested keeper), or implicit (default-Keep in an unreviewed low/medium-confidence cluster) — neither half is deleted. Pair-fanout deletes a partner only when that partner is itself marked Delete, auto-selected for Delete by a high-confidence cluster, or is a singleton outside any cluster. Metadata sidecars (`.xmp`, and `.aae` edit instructions, including the iPhone form where `IMG_<digits>.<ext>` owns `IMG_E<digits>.aae` in the same folder with exactly the same digits) extend this rule: a sidecar travels with its parent photo as a unit and is trashed only when **every** photo that references it is also being deleted (and no surviving pair partner shares its basename). A sidecar shared across a basename unit — `photo.xmp` applies to both `photo.raw` and `photo.jpg` — survives if any owner is kept.
- **INV-14:** Pair-as-unit conflict resolution is **Keep-wins**: when either half of a RAW+JPEG or Live Photo HEIC+MOV pair has an effective Keep — explicit, automatic (the cluster's auto-suggested keeper), or implicit (default-Keep in an unreviewed low/medium-confidence cluster) — neither half is deleted. Pair-fanout deletes a partner only when that partner is itself marked Delete, auto-selected for Delete by a high-confidence cluster, or is a singleton outside any cluster. When a plan is built from reviewed groups only, a partner that belongs to a group not yet reviewed is never added by fan-out; its own group decides once it is reviewed. Metadata sidecars (`.xmp`, and `.aae` edit instructions, including the iPhone form where `IMG_<digits>.<ext>` owns `IMG_E<digits>.aae` in the same folder with exactly the same digits) extend this rule: a sidecar travels with its parent photo as a unit and is trashed only when **every** photo that references it is also being deleted (and no surviving pair partner shares its basename). A sidecar shared across a basename unit — `photo.xmp` applies to both `photo.raw` and `photo.jpg` — survives if any owner is kept.
- **INV-15:** Organize and dedupe traversal must not follow symlinks or aliases by default. Skip symlink files/directories, app bundles, photo libraries, packages, hidden system-like containers, and any path that escapes the selected root.
- **INV-16:** Fast destination scans are validating scans: cached records are trusted only when the file still exists and size/mtime still match; stale cache rows are refreshed or removed.
- **INV-17:** Dedupe mutation plans are immutable content-verified snapshots. The planner never reads live filesystem identity; missing target hashes fail closed and exclude that path from deletion.
Expand Down
11 changes: 11 additions & 0 deletions DECISIONS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Decisions

## Release 2.1 bug sweep (2026-11-29)

- Pair fan-out and unreviewed groups (INV-14; decided by the agent during the sweep, approved by the owner 2026-11-29): the commit plan is built from reviewed groups only, so a RAW or Live Photo partner sitting in an unreviewed group had no decision and was added to the plan while its own group showed it as kept. The planner now takes `fanoutProtectedPaths`; the store passes the members of unreviewed groups for the reviewed plan, the free removal batch and the lane summaries. A held-back partner stays until its own group is reviewed, which can leave a RAW without its JPEG. Planning over all groups is unchanged.
- Undo history in Deduplicate is discarded when a scan starts, on reset, and when a commit completes, so an Undo from an earlier scan cannot rewrite a restored review.
- The unlock sheet's Return key takes the free action whenever one is offered, even where the action list puts Buy first.
- Dedupe review panes show Keep for a member with no decision in a group the planner will not auto-select, because that is what the plan does (edit preservation B-3; approved by the owner 2026-11-29).
- Companion owner lookup is indexed per folder; a seeded equivalence test pins it to the per-pair rules in `nameForm`.
- Closing a refusal sheet after a copy requested from a finished preview restores that preview. This also covers a refused plain Start Copying, not only the free-month proposal.
- A count of 1 on the dedupe unlock button reads "Unlock to Remove 1 Duplicate" (implementer's wording; approved by the owner 2026-11-29).
- Not built, needs a design decision: skipping a companion whose owner failed verification (edit preservation B-2, item 3). Copy jobs carry no owner link and owner and companion can be prepared in the same concurrent batch.

## German translation import (2026-11-15)

- Merge only German translations for existing keys from `/Users/nishithnand/Downloads/Translation DE`; preserve current keys, English, other languages and extraction metadata. The supplied catalogs predate newer app copy, which continues to fall back to English. Omit the unused incoming `%d duplicates found` key.
Expand Down
4 changes: 2 additions & 2 deletions docs/plan/edit-preservation/BLOCKED.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Rule: log it, then continue with the next independent WP. Only Nishith marks an
- **Tried:** confirmed none needs a cache or receipt schema change and none breaks an AGENTS.md invariant (no overwrite, no deletion); WP-04 proceeds.
- **Options:** 1) Follow-up PR: widen the tmp regex to `\.[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)?` before the UUID, and teach `parseFileBucket` to strip a known companion extension first. 2) Map appended-form companions to stem form in the destination (contradicts C-03.4 and breaks darktable's naming).
- **Recommendation:** Option 1 as a small follow-up PR with tests, since both are one-line pattern changes in safety-adjacent files that deserve their own review.
- **Status:** open
- **Status:** partly built, awaiting the owner's mark. Items 1 and 2 (temp pattern, `parseFileBucket`) are in `1c2c6633` on `fix/release-2.1-followups`. Item 4 (skip a companion whose owner did not finalize) and item 3 (`_collision_N`) are not built: copy jobs carry no owner link, and owner and companion can be prepared in the same concurrent batch, so both need the same design decision (in-memory link passed to the executor, a `CopyJobs` column, or ordering companions after their owner).

### B-3 — Review panes can label a protected edited variant "Suggested for removal" (non-blocking)
- **WP:** WP-08
Expand All @@ -38,4 +38,4 @@ Rule: log it, then continue with the next independent WP. Only Nishith marks an
- **Tried:** confirmed outside WP-08's owned paths (D-EPR-122 covers the store only); not folded in.
- **Options:** 1) Follow-up PR routing those panes through `DedupeDecisions.keepersForCluster` (or a shared effective-decision helper) with an App test. 2) Leave as is.
- **Recommendation:** Option 1, a small follow-up so the review UI never contradicts the plan.
- **Status:** open
- **Status:** fix built, awaiting the owner's mark. `5379edf7` on `fix/release-2.1-followups`: the panes read `DedupeDecisions.effectiveDecision`.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class HistoryCoordinator {
/// its own commit-progress surface.
func revertHistoryEntry(_ entry: RunHistoryEntry) {
guard !runSessionStore.isRunning, !deduplicateSessionStore.isWorking else {
reportTransientError("Stop the current run before reverting history.")
reportTransientError(String(localized: "Stop the current run before reverting history.", bundle: .module))
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ final class RunCoordinator {
guard Self.pathsMatch(activeDestination, context.destinationPath) else {
activeWatchedImportContext = nil
reportTransientError(
"The destination changed after this import was previewed. Open Sources and use Review & Import again."
String(localized: "The destination changed after this import was previewed. Open Sources and use Review & Import again.", bundle: .module)
)
return
}
Expand All @@ -195,7 +195,7 @@ final class RunCoordinator {
guard Self.pathsMatch(activeDestination, context.destinationPath) else {
discardPhotosImportContext()
reportTransientError(
"The destination changed after this import was previewed. Open Photos and use Review & Import again."
String(localized: "The destination changed after this import was previewed. Open Photos and use Review & Import again.", bundle: .module)
)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -563,17 +563,17 @@ final class SetupCoordinator {
func saveCurrentPathsAsProfile() {
let name = setupStore.newProfileName.trimmingCharacters(in: .whitespacesAndNewlines)
guard !name.isEmpty else {
setTransientErrorMessage("Enter a profile name before saving.")
setTransientErrorMessage(String(localized: "Enter a profile name before saving.", bundle: .module))
return
}

guard setupStore.sourceItems.count <= 1 else {
setTransientErrorMessage("A saved profile holds one folder. Keep this list as it is (Chronoframe remembers it), or remove the extra folders to save a profile.")
setTransientErrorMessage(String(localized: "A saved profile holds one folder. Keep this list as it is (Chronoframe remembers it), or remove the extra folders to save a profile.", bundle: .module))
return
}

guard !setupStore.sourcePath.isEmpty, !setupStore.destinationPath.isEmpty else {
setTransientErrorMessage("Choose both a source and destination before saving a profile.")
setTransientErrorMessage(String(localized: "Choose both a source and destination before saving a profile.", bundle: .module))
return
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ final class SourceWatchCoordinator {
destinationPaths: [setupStore.destinationPath, deduplicateDestinationPath()],
existingWatchedPaths: store.states.map(\.source.path)
) {
reportTransientError(conflict.errorDescription ?? "That folder can't be watched.")
reportTransientError(conflict.errorDescription ?? String(localized: "That folder can't be watched.", bundle: .module))
return
}

Expand Down Expand Up @@ -722,7 +722,7 @@ final class SourceWatchCoordinator {
destinationPaths: [setupStore.destinationPath, deduplicateDestinationPath()],
existingWatchedPaths: otherPaths
) {
reportTransientError(conflict.errorDescription ?? "That folder can't be watched.")
reportTransientError(conflict.errorDescription ?? String(localized: "That folder can't be watched.", bundle: .module))
return
}

Expand Down Expand Up @@ -779,7 +779,7 @@ final class SourceWatchCoordinator {
try runScan(rootURL, scanTime)
}.value
guard let result = scanResult, result.completeness.isComplete else {
reportTransientError("Chronoframe couldn't fully check this folder, so it can't safely ignore its items yet. Try again once the folder is readable.")
reportTransientError(String(localized: "Chronoframe couldn't fully check this folder, so it can't safely ignore its items yet. Try again once the folder is readable.", bundle: .module))
return
}
entries = result.entries
Expand Down Expand Up @@ -810,12 +810,12 @@ final class SourceWatchCoordinator {
}
let destination = setupStore.destinationPath.trimmingCharacters(in: .whitespacesAndNewlines)
guard !destination.isEmpty else {
reportTransientError("Choose a destination folder in Organize → Choose Folders first; watched folders import into it.")
reportTransientError(String(localized: "Choose a destination folder in Organize → Choose Folders first; watched folders import into it.", bundle: .module))
return
}
guard let bookmark = preferencesStore.bookmark(for: Self.bookmarkKey(for: id)) else {
store.setAvailability(id: id, .accessLost)
reportTransientError("Chronoframe lost access to this folder. Choose it again to keep watching.")
reportTransientError(String(localized: "Chronoframe lost access to this folder. Choose it again to keep watching.", bundle: .module))
return
}

Expand Down
28 changes: 22 additions & 6 deletions ui/Sources/ChronoframeApp/AppIntents/OrganizeFolderIntent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,36 @@ public struct OrganizeFolderIntent: AppIntent {
"Successfully organized folder. Transferred \(copiedCount == 1 ? "1 file" : "\(copiedCount) files")."
}

/// The run this intent performs. The layout is the person's own, read through
/// `PreferencesStore`, so a Shortcut run lands in the same library layout as the app.
@MainActor
public func perform() async throws -> some IntentResult & ReturnsValue<String> {
let sourcePath = sourceFolder.path
let destinationPath = destinationFolder.path

let config = RunConfiguration(
static func makeConfiguration(
sourcePath: String,
destinationPath: String,
preferences: PreferencesStore
) -> RunConfiguration {
RunConfiguration(
mode: .transfer,
sourcePath: sourcePath,
destinationPath: destinationPath,
profileName: nil,
verifyCopies: true,
parallelTransferEnabled: true,
workerCount: 8,
folderStructure: .default
folderStructure: preferences.folderStructure
)
}

@MainActor
public func perform() async throws -> some IntentResult & ReturnsValue<String> {
let sourcePath = sourceFolder.path
let destinationPath = destinationFolder.path

// Built from `PreferencesStore` directly: a Shortcut can run before `AppState` exists.
let config = Self.makeConfiguration(
sourcePath: sourcePath,
destinationPath: destinationPath,
preferences: PreferencesStore()
)

let sourceStart = sourceFolder.startAccessingSecurityScopedResource()
Expand Down
136 changes: 136 additions & 0 deletions ui/Sources/ChronoframeApp/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,23 @@
}
}
},
"%@ need review" : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ zu prüfen"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "%@ need review"
}
}
}
},
"1 more is waiting. Your choices are saved; scan again to continue." : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -1096,6 +1113,23 @@
}
}
},
"1 needs review" : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "1 zu prüfen"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "1 needs review"
}
}
}
},
"1 photo or video" : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -3077,6 +3111,23 @@
}
}
},
"Chronoframe can’t currently access “%@”. Choose this same folder again to restore access and load History. Reconnecting does not change your media files." : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Chronoframe kann derzeit nicht auf „%@“ zugreifen. Wähle genau diesen Ordner erneut, um den Zugriff wiederherzustellen und den Verlauf zu laden. Das erneute Verbinden ändert deine Mediendateien nicht."
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Chronoframe can’t currently access “%@”. Choose this same folder again to restore access and load History. Reconnecting does not change your media files."
}
}
}
},
"Chronoframe copies your photos out of Apple Photos into this folder. Your Photos library is never changed." : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -3305,6 +3356,74 @@
}
}
},
"Found 1 media file, but a preview couldn't be created for it." : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "1 Mediendatei gefunden, aber es konnte keine Vorschau erstellt werden."
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Found 1 media file, but a preview couldn't be created for it."
}
}
}
},
"Library shape: %@ healthy, %@, %@ critical" : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Zustand der Mediathek: %@ einwandfrei, %@, %@ kritisch"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Library shape: %@ healthy, %@, %@ critical"
}
}
}
},
"the folders you choose" : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "deinen gewählten Ordnern"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "the folders you choose"
}
}
}
},
"Unlock to Remove 1 Duplicate" : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Freischalten, um 1 Duplikat zu entfernen"
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Unlock to Remove 1 Duplicate"
}
}
}
},
"Your originals are never changed and nothing is copied yet. You can keep using your Mac." : {
"extractionState" : "manual",
"localizations" : {
Expand Down Expand Up @@ -11996,6 +12115,23 @@
}
}
},
"Your originals in %@ are opened as read-only. Original files are never modified, moved, or deleted." : {
"extractionState" : "manual",
"localizations" : {
"de" : {
"stringUnit" : {
"state" : "translated",
"value" : "Deine Originale in %@ werden schreibgeschützt geöffnet. Originaldateien werden nie verändert, verschoben oder gelöscht."
}
},
"en" : {
"stringUnit" : {
"state" : "translated",
"value" : "Your originals in %@ are opened as read-only. Original files are never modified, moved, or deleted."
}
}
}
},
"Your originals were not changed. The report and the receipt for undoing this copy are in History." : {
"extractionState" : "manual",
"localizations" : {
Expand Down
Loading
Loading