Add CI detection for grafted commits and large commits before lock file rebuild #10370
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.
PR #10356 merged a grafted commit with 2,456 files (808K+ insertions) after reverting accidentally-included lock files, causing
make recompileto fail. This was the 5th lock file recompilation failure on 2026-01-16.Changes
Added two validation steps to the CI build job before "Rebuild lock files":
git log -1 --onelinefor(grafted)marker and fails with exit 1$GITHUB_STEP_SUMMARYBoth write diagnostic information to the workflow summary for visibility.
Implementation
Rationale
Grafted commits indicate shallow history or history manipulation that breaks repository integrity. Detecting them before
make recompileprovides immediate feedback rather than cryptic compilation failures. The 100-file threshold catches accidental mass-commits (like the 110+ lock files in #10356) while allowing legitimate large changes to proceed with a warning.Original prompt
This section details on the original issue you should resolve
<issue_title>[CI Failure Doctor] 🏥 CI Failure Investigation - Grafted Commit After Lock File Revert (Run #30058)</issue_title>
<issue_description># 🏥 CI Failure Investigation - Run githubnext/gh-aw#30058
Summary
Fifth lock file recompilation failure today, but with a different root cause: PR #10356 created a grafted commit (shallow history) containing 2,456 files after reverting accidentally-included lock files, causing
make recompileto fail.Failure Details
2a1b6bcc795680d118d0ec8b0ae56e3e22ef6eff(marked asgrafted)pushto main branchRoot Cause Analysis
What Happened
.lock.ymlfiles in the commitmake recompilestep fails on the build jobEvidence
PR Comments Confirm the Issue
From PR #10356:
The revert operation created a grafted commit that included the entire repository history.
Failed Jobs and Errors
Job: build (60621009735)
make recompilefailedToday's Lock File Failure Pattern (2026-01-16)
This is the FIFTH "Rebuild lock files" failure today:
Pattern shift: First 4 failures were validation bugs; this one is a repository integrity issue.
Investigation Findings
Why This Is Different
Previous failures (1-4): Code changes broke validation
THIS failure (#5): Repository history manipulation
Red Flags
(grafted)marker - indicates history manipulation.github/workflows/directoryRecommended Actions
Immediate (Fix This Failure)
2a1b6bc- The grafted commit must be removed from maindocs/astro.config.mjs(author name changes)docs/src/styles/custom.css(styling overrides)make agent-finishbefore merging the clean PRShort-term (Prevent Recurrence)