test: cover the behaviour that was shipping unverified - #90
Draft
pixincreate wants to merge 1 commit into
Draft
Conversation
git_available() turned twelve tests into silent no-ops if git were missing, including every --staged and baseline integration test; git is a hard dependency of those modes, so it now fails loudly. The staged scan's git-config hardening had no test at all, despite being the fix for a bypass: deleting any of the overrides made the scan report clean or attribute findings to a mangled path, and nothing failed. One test now sets all five hostile settings at once and asserts the path and line survive. Also newly covered: the scanner exits 2 outside a repository, which is what makes the hook fail closed; path operands actually narrow the staged diff; a config at the repository root is discovered, which depends on candidate lookup preceding the .git stop check; and the prefilter selects both owners of overlapping keywords, without which Stripe detection would silently stop running behind Adyen's shorter keyword. CI never ran KeyWatch against itself, so a committed secret or a stale baseline would ship green.
pixincreate
force-pushed
the
chore/cleanup
branch
from
August 26, 2026 17:32
93353a1 to
93b4574
Compare
pixincreate
force-pushed
the
test/ci-hardening
branch
from
August 26, 2026 17:32
9d2b52b to
191c9b9
Compare
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.
Stacked on #89 — top of the stack.
Summary
Closes the coverage gaps where a regression would have shipped green, and makes CI run KeyWatch against itself.
Changes
git_available()silently skipped 12 tests — every--stagedand baseline integration test — if git were missing. Git is a hard dependency of those modes, so it now fails loudly instead of reporting green while covering nothing.color.ui=always,diff.mnemonicPrefix,diff.noprefix,core.quotePathanddiff.relativesimultaneously and asserts the path and line survive..gitstop check — both prior tests passed either way); and the prefilter selects both owners of overlapping keywords, without which Stripe detection silently stops running behind Adyen's shortersk_.self-scanjob scans the repo, fails if the committed baseline has drifted, and checks the framework hook entry still usesscan --staged.Tests
192 pass (was 177 at the base of this stack), clippy and fmt clean.