fix(sovereign-ci): self-heal broken sibling clone cache#24
Merged
Conversation
Root cause (bashrs#197 coverage failure):
The sibling checkout step had `|| true` on fetch, silently masking
a broken cached clone. Script flow:
if [ -d "$repo" ]; then
git fetch ... && reset --hard ... || true # swallows errors
else
for attempt ...; do git clone ...; done
fi
When cache dir exists but is empty/broken (runner workspace leftover),
the fetch fails but `|| true` eats the error. Next step (cargo metadata)
then fails with 'No such file or directory' pointing at the missing
Cargo.toml — 20s into coverage, not at the sibling-clone step.
Five-whys:
1. Why did cargo metadata fail? Missing provable-contracts Cargo.toml
2. Why missing? Sibling dir exists but is empty
3. Why empty? Fetch into existing broken cache failed
4. Why silent? `|| true` swallowed the error
5. Why defensive? To tolerate offline/transient failures — but it
hid real ones too
Fix: validate cache with `git rev-parse HEAD`. If HEAD missing OR
fetch fails, rm -rf + re-clone. Drop --quiet from clone so output
is visible on failure.
Applied to all 5 jobs (test, lint, coverage, security, provenance).
No caller changes needed — `uses: @main` picks up fix automatically.
Refs paiml/bashrs#197 (coverage blocker after 10d cache staleness)
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
Five whys
Affected jobs
All 5 of: test, lint, coverage, security, provenance (each had a duplicate copy of the sibling-clone block).
Test plan
Refs paiml/bashrs#197
🤖 Generated with Claude Code