fix(xim): staged + atomic git index acquisition; catalog self-heal (A3)#353
Merged
Conversation
git_clone_one (and the cancellable inline clone) previously removed the live tree BEFORE acquiring its replacement — a failed pull/re-clone left nothing behind and surfaced much later as 'failed to build catalog: pkgs/ directory not found' (observed twice on 2026-07-08). Clones now land in a sibling .staging dir and atomically swap into place (live -> .old -> swap -> drop); when every URL fails and a previous copy exists, it is KEPT (stale-but-consistent beats absent) with a loud fetch-time warning. get_catalog() additionally self-heals: on rebuild failure it resyncs repos and rebuilds once before telling the user to run 'xlings update' themselves. This brings the GIT acquisition path up to the guarantees the artifact path already has since 0.4.62 (indexfetch.cppm staged swap + orphan recovery). Note: today's incidents ran xlings v0.4.44 pins — bumping consumer pins to >=0.4.62 is the companion fix. Verified: built with mcpp; isolated-XLINGS_HOME behavior test — fresh update populates via staging with no leftovers; a broken-remote update keeps the previous index tree and the catalog stays usable. Pre-existing test_mirror failures are environmental (user-level ~/.xlings/data/github-mirrors.json override with an empty mirror list; identical on clean main). Design: mcpp .agents/docs/2026-07-08-root-cause-remediation-design.md A3.
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.
Brings the git index-acquisition path up to the atomicity guarantees the artifact path gained in 0.4.62. See commit message; design in mcpp
.agents/docs/2026-07-08-root-cause-remediation-design.md§A3. Companion: consumer CI pins should move to ≥0.4.62 (openxlings/xim-pkgindex#343 bumps them).