Repository navigation
Decision import: only execute groups that agree with the rules - #536
Merged
Merged
Conversation
Importing discarded paths (Immich trash) used to make the remaining file the user keeper for every group where all but one member were discarded. Now the outcome is split: - agrees_with_rules: the remaining file is the rule keeper, executed as before - disagrees_with_rules: nothing is executed, the group goes to review with the other tool's choice stored as suggestion (groups.suggested_keep_path / suggestion_source), which can be accepted with one click in the group view Suggestions survive new runs (record_group keeps the group in review and the deduplicator holds it while the rules keep another file), re-imports only refresh them. The preview lists the disagreeing groups with resolution, file size and EXIF tag count of both files and the deciding rule. The groups list can be filtered by groups with a suggestion. New columns are added to existing state databases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Importing decisions from another tool (
POST /api/decisions/import-discarded,POST /api/integrations/immich/import-trash) no longer executes every group where all but one member were discarded. The formerdecidedoutcome is split:agrees_with_rules: the remaining file is the rule keeper. Same as before: it becomes the user keeper and the daemon moves the other files.disagrees_with_rules: nothing is executed and no user keeper is set. The group goes to review (status=review,needs_review, reason likeImmich kept <path>, the rules keep <path>). The other tool's choice is stored as a suggestion in the new columnsgroups.suggested_keep_path/suggestion_source(immich/import).Details:
record_groupkeeps such groups in review and combines the suggestion reason with a weak-rule reason without duplicating it. The deduplicator holds them as long as the rules keep another file, regardless ofhold_ambiguous_groups. Once the rules agree, the hold ends.already_suggested. Groups decided by the user, ignored or resolved are not changed (same as before).agreeinganddisagreeing. For each disagreement it lists both keep paths, pixel count, file size and EXIF tag count of both files, anddecided_by._ADDED_COLUMNS,ALTER TABLE ADD COLUMNif missing),SCHEMA_VERSION2./groups/<id>. The apply button and text make clear that only agreeing groups are executed.POST /api/groups/{id}/keep).has_suggestion, also in the bulk filter).Test plan
poetry run pytest(153 passed): store tests for both outcomes, preview vs. apply, idempotence, persistence across rule runs, migration of an old database; deduplicator hold test; API preview/apply testnpm --prefix web run lint,npm --prefix web run build🤖 Generated with Claude Code