Fail loudly when a probe is not staged - #109
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe RNG hygiene test harness now confirms that each probe exists in the temporary Git index before invoking the hygiene guard. Missing probes produce a harness failure, trigger cleanup, and skip the guard check. ChangesRNG hygiene test harness
Estimated code review effort: 1 (Trivial) | ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
Backports the probe-staged assertion from privkeyio/keep-android#473 and privkeyio/keep#936, so the four copies of this harness do not diverge.
The gap
run_probediscards the errors fromgit read-treeandgit add. The existingstaged -lt 10check does not cover a failedgit add: HEAD's whole tree is still in the index, so the count sails past 10 while the probe itself is missing, and the guard is then judged on a file it never received.A reject case surfaces that as a spurious
BYPASS, which sends someone hunting a guard defect that does not exist. An accept case surfaces it as a silent pass.Now asserted directly:
Test plan
git addwith a no-op makes every case reportHARNESS BROKEN, with zeroBYPASSlines. Before this change the same sabotage producedBYPASS, the misleading resultWorth recording how this landed: the first attempt at this backport spliced the block into the middle of an echo string, because the insertion anchored on
fiand matched thefiinside the wordfile(s). The corrupted file still parsed underbash -nand the self-test still reported OK, so "it passes" was true and meaningless. The sabotage control is what caught it. Re-anchored onlocal rc=0 out, which appears once.Summary by CodeRabbit