Repository navigation
Clone gate scans the branch being cloned; coverage note no longer denies low findings - #9
Merged
Merged
Conversation
The clone gate ran `flagrix scan <url> --json` with no --ref, so `git clone --branch release …` (or -b) was gated on the default branch instead of release. Parse --branch/--branch=/-b from the clone itself (not from other commands on the same line, and after -- for gh repo clone) and pass it as --ref; name the branch in the block message. Adds hook tests that run the script with a stubbed npx, and documents what the hook does and doesn't scan in docs/agent-gating.md.
On an incomplete low scan describeCoverage always ended with "Nothing was found in what was read", even when low-weight findings were listed right below it. Pass the finding count and say "only low-weight findings" when there are some; the zero-findings sentence is unchanged.
The matcher only knew `git clone`, so `git -C /tmp clone …`, `git -c key=val clone …` and `git --git-dir=… clone …` passed ungated. Allow any run of git global options (with quoted or unquoted values) between `git` and `clone`. docs/agent-gating.md no longer says "every git clone is gated": it says recognized git clone / gh repo clone commands are, and that the hook reads command text, so clones behind aliases, variables or scripts are not seen.
Bumps the package, the lockfile, `flagrix --version`, the MCP server's reported version and both versions in server.json to 0.5.1, and syncs the bundled rules snapshot to 2026.11.10.001. Patch: the clone gate now scans the branch being cloned and recognizes git options before `clone`, and the incomplete-scan note no longer says nothing was found when low findings exist. No JSON or flag changes.
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.
What changed
Clone gate scans the branch the clone checks out (
hooks/flagrix-clone-gate.sh)npx -y flagrix scan "$url" --jsonwith no--ref, sogit clone --branch release …/-b releasewas gated on the default branch, notrelease.--branch <name>,--branch=<name>and-b <name>(also after--ingh repo clone owner/repo -- -b <name>) and passes the value as--ref. Only the clone command itself is read, sogit checkout -b wip && git clone …does not pick upwip.--bareis not mistaken for-b.git -C <dir> clone …,git -c key=val clone …,git --git-dir=… clone …(quoted values included). Before, the matcher only knewgit clone, so these passed ungated.--ref.docs/agent-gating.mdno longer says "everygit cloneis gated". It now says recognizedgit clone/gh repo clonecommands are gated, and that the hook reads command text, so a clone behind an alias, variable or script isn't seen. It also says what the hook scans: the checked-out branch (or the default branch), pinned to the commit at scan time. It does not cover other fetched branches/tags, or a push between the scan and the clone.tests/clone-gate.test.tsruns the real script with a stubbednpxon PATH (20 cases).Coverage note on an incomplete low scan (
src/lib/coverage.ts)describeCoveragealways ended with "Nothing was found in what was read", even when low-weight findings were printed with it (a real scan showed it above "7 issues").Checks
npm run typecheckis clean andnpm testpasses (59 tests).Not in this PR
assets/signatures-snapshot.jsonstill holds the oldBACKDOOR_HARDCODED_AUTHdescription until BACKDOOR_HARDCODED_AUTH: describe what the pattern matches (2026.11.10.001) flagrix-detection-rules#7 is merged andnpm run sync-signaturesruns (it does onprepublishOnly).