Skip to content

fix(xim): staged + atomic git index acquisition; catalog self-heal (A3)#353

Merged
Sunrisepeak merged 1 commit into
mainfrom
fix/atomic-index-fetch
Jul 8, 2026
Merged

fix(xim): staged + atomic git index acquisition; catalog self-heal (A3)#353
Sunrisepeak merged 1 commit into
mainfrom
fix/atomic-index-fetch

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

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).

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.
@Sunrisepeak Sunrisepeak merged commit 37fedb7 into main Jul 8, 2026
7 checks passed
@Sunrisepeak Sunrisepeak deleted the fix/atomic-index-fetch branch July 8, 2026 15:35
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.

2 participants