Skip to content

fix: deduplicate reconsolidation candidates with same name across images#2063

Merged
mattgodbolt merged 2 commits intomainfrom
claude/fix-cefs-recon-dedup
Apr 11, 2026
Merged

fix: deduplicate reconsolidation candidates with same name across images#2063
mattgodbolt merged 2 commits intomainfrom
claude/fix-cefs-recon-dedup

Conversation

@mattgodbolt-molty
Copy link
Copy Markdown
Contributor

Problem

CEFS consolidation failed on 2026-04-11 (run #24277747674):

ValueError: Duplicate subdir name 'compilers_swift_post-6-2_6.2.4' in
consolidation group: 'compilers/swift/post-6-2 6.2.4'
(from_reconsolidation=True) conflicts with 'compilers/swift/post-6-2 6.2.4'

The previous fix (#2059) only handled fresh-item vs reconsolidation-item collisions. This collision involved two reconsolidation candidates — the same installable appearing in two different old consolidated images (likely from multiple consolidation passes accumulating the same item in multiple images).

Neither item was in the fresh items list, so the fresh-vs-recon filter didn't trigger. Both ended up in the same group and produced the same sanitized subdir name.

Fix

After filtering fresh-vs-recon collisions, deduplicate within the reconsolidation candidates themselves. When the same installable name appears in multiple old consolidated images, keep only the first occurrence.

The detection layer in (ValueError on duplicate subdir names) correctly caught and reported the issue; this PR fixes the prevention layer.

Test

New test test_prepare_consolidation_items_rejects_duplicate_recon_names reproduces the exact production scenario: two recon candidates from different consolidated images with the same installable name.

(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)

… images

## Problem

CEFS consolidation failed again (2026-04-11, run #24277747674) with:

  ValueError: Duplicate subdir name 'compilers_swift_post-6-2_6.2.4' in
  consolidation group: 'compilers/swift/post-6-2 6.2.4'
  (from_reconsolidation=True) conflicts with 'compilers/swift/post-6-2 6.2.4'

The previous fix (#2059) only filtered out reconsolidation candidates whose name
appeared as a fresh item. But this collision involved TWO reconsolidation
candidates — the same installable appearing in two different old consolidated
images (likely due to multiple consolidation passes over time).

## Fix

After filtering fresh-vs-recon collisions, also deduplicate within the
reconsolidation candidates themselves. When the same installable name appears
in multiple old consolidated images, only the first occurrence is kept.

The detection layer in consolidation.py (ValueError on duplicate subdir names)
correctly caught and reported the issue; this PR fixes the prevention layer.

## Test

New test `test_prepare_consolidation_items_rejects_duplicate_recon_names`
reproduces the exact production scenario: two reconsolidation candidates from
different consolidated images both with name 'compilers/swift/post-6-2 6.2.4'.

🤖 Generated by LLM (Claude, via OpenClaw)
…ates

When the same installable appears in multiple old consolidated images, sort
by squashfs mtime (newest first) before deduplicating, so we retain the
candidate from the most recently created consolidated image rather than
arbitrarily the first one encountered.

This ensures that if content somehow diverged between reconsolidations
(e.g. reinstall between consolidation passes), we pick the most up-to-date.

🤖 Generated by LLM (Claude, via OpenClaw)
@mattgodbolt mattgodbolt requested a review from Copilot April 11, 2026 19:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mattgodbolt mattgodbolt merged commit c0caa7e into main Apr 11, 2026
1 check passed
@mattgodbolt mattgodbolt deleted the claude/fix-cefs-recon-dedup branch April 11, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants