fix(skills/update-stack): switch drift gate scan to git diff (catches missing-locally case)#3783
Conversation
… missing-locally case) Replace `git ls-files` iteration (locally-present files only) with `git diff --name-only devkit-node/master HEAD` (bidirectional). Adds a second BLOCK arm for files present upstream but absent locally — the previous scan silently skipped deleted stack files. Closes #3779
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughUpdated the ChangesDrift Gate Scan Refactoring
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the /update-stack skill’s “3ter: Block on drift” gate to detect stack-file drift using a symmetric upstream-vs-local diff, including the previously undetectable “present upstream but missing locally” case.
Changes:
- Switches the drift scan source from
git ls-files(local-only enumeration) togit diff --name-only devkit-node/master HEADovermodules/,lib/, andconfig/. - Adds an explicit BLOCK path for “missing locally (was on upstream)” with a restore command hint.
- Updates the documented rule to explain why
git diffis used (bidirectional change detection).
| local_blob=$(git rev-parse "HEAD:$f" 2>/dev/null) | ||
| if [ "$upstream_blob" != "$local_blob" ]; then | ||
| echo "BLOCK: drift on shared stack file: $f" | ||
| # Both sides exist + differ → drift |
Summary
git ls-files modules lib configiteration (locally-present files only) withgit diff --name-only devkit-node/master HEAD(bidirectional diff)BLOCKarm: files present upstream but absent locally →BLOCK: missing locally (was on upstream)with a restore hintgit diffwas chosen overgit ls-filesRoot cause
The old gate iterated
git ls-fileswhich only enumerates files that exist in the working tree. A file deleted from a downstream (but still in upstream) was silently skipped — the gate could never detect the "missing locally" case.Test plan
bash -c '...'on the gate block — exits 0 on clean tree3ter: no drift — OKon a clean downstream after/update-stackmissing locallymessageCloses #3779
Summary by CodeRabbit
/update-stackcommand to identify content mismatches and missing upstream files.